Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-24154

Overriding template with section_identifier fails when cached

    Details

      Description

      If a template is declared to override using the match by section_identifier, and the view cache is enabled, the cached versions will fall back to default templates and ignore the overrides.

      test case:
      1 - setting up the environment

      • enable debug and list templates options in admin
      • create a section called "test" (name and identifier)
      • create a folder X, set the section to "test"
      • assign anonymous user permissions to read section "test"
      • open X in frontend
      • check the full path of the "pagelayout.tpl" used, to override it. it will depend on the extension used to generate the frontend (ezflow, ezdemo, etc)

      2 - making the override

      • edit the "pagelayout.tpl" file with some change, save it at the path <extension>/overrides/templates/modified_pagelayout.tpl
      • add to the default frontend siteaccess settings/override.ini.append.php:

          [pagelayout_section_test]
          Source=pagelayout.tpl
          MatchFile=modified_pagelayout.tpl
          Subdir=templates
          Match[section_identifier]=test
        

      • clear all caches
      • open X in frontend. the modified_pagelayout.tpl is used, at bottom of debug it can be checked the correct usage.
      • reload the page, view falls back to default template. the debug at bottom shows that none of the templates are overriden.

        Activity

        Paulo Bras (Inactive) created issue -
        Paulo Bras (Inactive) made changes -
        Field Original Value New Value
        Status Open [ 1 ] Confirmed [ 10037 ]
        Paulo Lopes (Inactive) made changes -
        Status Confirmed [ 10037 ] InputQ [ 10001 ]
        André Rømcke made changes -
        Assignee André Rømcke [ andre.romcke@ez.no ]
        André Rømcke made changes -
        Status InputQ [ 10001 ] Development [ 3 ]
        André Rømcke made changes -
        Status Development [ 3 ] Development Review [ 10006 ]
        Fix Version/s 4.7 Maintenance [ 12583 ]
        Fix Version/s 5.3.5 [ 13889 ]
        Fix Version/s 5.4.2 [ 13979 ]
        André Rømcke made changes -
        Description If a template is declared to override using the match by section, and the view cache is enabled, the cached versions will fall back to default templates and ignore the overrides.

        test case:
        1 - setting up the environment
        - enable debug and list templates options in admin
        - create a section called "test"
        - create a folder X, set the section to "test"
        - assign anonymous user permissions to read section "test"
        - open X in frontend
        - check the full path of the "pagelayout.tpl" used, to override it. it will depend on the extension used to generate the frontend (ezflow, ezdemo, etc)

        2 - making the override
        - edit the "pagelayout.tpl" file with some change, save it at the path <extension>/overrides/templates/modified_pagelayout.tpl
        - add to the default frontend siteaccess settings/override.ini.append.php:
        {code}
          [pagelayout_section_test]
          Source=pagelayout.tpl
          MatchFile=modified_pagelayout.tpl
          Subdir=templates
          Match[section]=test
        {code}
        - clear all caches
        - open X in frontend. the modified_pagelayout.tpl is used, at bottom of debug it can be checked the correct usage.
        - reload the page, view falls back to default template. the debug at bottom shows that none of the templates are overriden.

        If a template is declared to override using the match by section_identifier, and the view cache is enabled, the cached versions will fall back to default templates and ignore the overrides.

        test case:
        1 - setting up the environment
        - enable debug and list templates options in admin
        - create a section called "test" (name and identifier)
        - create a folder X, set the section to "test"
        - assign anonymous user permissions to read section "test"
        - open X in frontend
        - check the full path of the "pagelayout.tpl" used, to override it. it will depend on the extension used to generate the frontend (ezflow, ezdemo, etc)

        2 - making the override
        - edit the "pagelayout.tpl" file with some change, save it at the path <extension>/overrides/templates/modified_pagelayout.tpl
        - add to the default frontend siteaccess settings/override.ini.append.php:
        {code}
          [pagelayout_section_test]
          Source=pagelayout.tpl
          MatchFile=modified_pagelayout.tpl
          Subdir=templates
          Match[section_identifier]=test
        {code}
        - clear all caches
        - open X in frontend. the modified_pagelayout.tpl is used, at bottom of debug it can be checked the correct usage.
        - reload the page, view falls back to default template. the debug at bottom shows that none of the templates are overriden.

        André Rømcke made changes -
        Summary legacy cache: overriding template with section matching fails Overriding template with section_identifier matching fails when cached
        André Rømcke made changes -
        Summary Overriding template with section_identifier matching fails when cached Overriding template with section_identifier fails when cached
        André Rømcke made changes -
        Status Development Review [ 10006 ] Development Review done [ 10028 ]
        Fix Version/s 5.1 Maintenance [ 12301 ]
        André Rømcke made changes -
        Affects Version/s 5.4.0 [ 13884 ]
        Affects Version/s 5.3 [ 11282 ]
        Affects Version/s 5.1 [ 11280 ]
        André Rømcke made changes -
        Status Development Review done [ 10028 ] Documentation Review done [ 10011 ]
        Rui Silva (Inactive) made changes -
        Status Documentation Review done [ 10011 ] QA [ 10008 ]
        Assignee André Rømcke [ andre.romcke@ez.no ] Rui Silva [ rui.silva@ez.no ]
        Rui Silva (Inactive) made changes -
        Assignee Rui Silva [ rui.silva@ez.no ]
        Status QA [ 10008 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        André Rømcke made changes -
        Workflow eZ Engineering Scrumban Workflow [ 66508 ] EZ* Development Workflow [ 85781 ]
        Alex Schuster made changes -
        Workflow EZ* Development Workflow [ 85781 ] EZEE Development Workflow [ 124685 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Paulo Bras (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: