AdHoc area definition is never created
--------------------------------------

                 Key: MAGNOLIA-4457
                 URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-4457
             Project: Magnolia
          Issue Type: Bug
      Security Level: Public
          Components: templating
    Affects Versions: 4.5
            Reporter: Jan Haderka
            Assignee: Philipp Bärfuss


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

        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();
        }
{noformat}

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?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       


----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to