Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-4457

AdHoc area definition is never created

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • 4.5.x
    • 4.5
    • templating

      at least what the code here looks like (AreaElement):

              this.isAreaDefinitionEnabled = areaDefinition != null && (areaDefinition.isEnabled() == null || areaDefinition.isEnabled());
      
              if (!this.isAreaDefinitionEnabled) {
                  return;
              }
              // set the values based on the area definition if not passed
              this.name = resolveName();
              this.dialog = resolveDialog();
              this.type = resolveType();
              this.label = resolveLabel();
              this.availableComponents = resolveAvailableComponents();
              this.inherit = isInheritanceEnabled();
              this.optional = resolveOptional();
              this.editable = resolveEditable();
      
              this.description = templateDefinition.getDescription();
      
              // build an adhoc area definition if no area definition can be resolved
              if(this.areaDefinition == null){
                  buildAdHocAreaDefinition();
              }
      

      When areaDefinition is null, whole condition will be evaluated as false and will return on the next line never reaching code below that would actually create it ad-hoc.

      Either it should be created in which case whole code should be refactored, or it should not in which case second if clause should be removed.

      While we are at it, what is the reason for AreaDefinition#isEnabled() returning boolean object rather then primitive?

        Acceptance criteria

              Unassigned Unassigned
              had Jan Haderka
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD