Uploaded image for project: 'Migration 4.4 to 4.5 (closed)'
  1. Migration 4.4 to 4.5 (closed)
  2. MGNLMIGRATION-137

ftl-Migration: Improve code substitution for new areas - current scripts produce syntactically invalid freemarker templates

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.2
    • 1.1.4
    • None
    • None
    • Migros project

      ftl-files that contain wrapper HTML-tags and if-statements around new-Bars are processed incorrectly. Code like

      [@cms.contentNodeIterator contentNodeCollectionName="linkList"]
          [@cms.includeTemplate /]
      [/@cms.contentNodeIterator]
      
      [#if mgnl.editMode]
          <li>
              [@cms.newBar contentNodeCollectionName="linkList" newLabel="${i18n['link.newLabel']}" paragraph="${def.subParagraphs}" /]
          </li>
      [/#if]
      

      is migrated to:

              [#--OLD  AREA
      [@cms.contentNodeIterator  contentNodeCollectionName="linkList"]
          [@cms.includeTemplate  /]
      [/@cms.contentNodeIterator]
      
      [#if  mgnl.editMode]
          <li>
              [@cms.newBar  contentNodeCollectionName="linkList" newLabel="${i18n['link.newLabel']}" paragraph="${def.subParagraphs}" /]
      AREA--][@cms.area  name = "linkList"  /]<p class="migration_warning">Please make sure that an area named linkList exists in your Magnolia configuration</p>
          </li>
      [/#if]
      

      leaving orphaned HTML-Tags (</li>) and if-statements (/#if) behind.

      The migration could be improved to produce something like:

      [#--OLD  AREA
      [@cms.contentNodeIterator  contentNodeCollectionName="linkList"]
          [@cms.includeTemplate  /]
      [/@cms.contentNodeIterator]
      AREA--]
      [@cms.area  name = "linkList"  /]<p class="migration_warning">Please make sure that an area named linkList exists in your Magnolia configuration</p>
      
      [#if  mgnl.editMode]
          <li>
              [#--OLD  AREA [@cms.newBar  contentNodeCollectionName="linkList" newLabel="${i18n['link.newLabel']}" paragraph="${def.subParagraphs}" /] AREA--]
          </li>
      [/#if]  
      

        Acceptance criteria

              rsiska Robert Šiška
              wolf.bubenik wolf bubenik
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: