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

Renaming parent leads to redirect loop when accessing old child location URLs

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: High High
    • Resolution: Fixed
    • Affects Version/s: 1.5.0
    • Fix Version/s: Customer request, 1.5.2, 1.6.1, 1.7.0
    • Component/s: None
    • Labels:
      None

      Description

      eZ Platform supports automatic redirect based on the URL history. This works fine on a top level, but currently a redirect loop is created when accessing child locations after renaming a parent.

      Steps to reproduce:

        Issue Links

          Activity

          Hide
          Jani Tarvainen added a comment -

          This was with 1.5.0 IIRC. Can verify.

          Show
          Jani Tarvainen added a comment - This was with 1.5.0 IIRC. Can verify.
          Show
          Bertrand Dunogier added a comment - PR https://github.com/ezsystems/ezpublish-kernel/pull/1798 .
          Hide
          André Rømcke added a comment - - edited

          For users looking for a fix for this right now apply 1798, or revert 18cfe9 which surfaced this issue in the first place.

          However the issue goes deeper internally so we will iterate a bit more to fix it the right way.

          Investigation/discussion so far in #1798 has reveled that there is an inconsistency somewhere in regards to UrlAlias SPI objects, which is made visible by 18cfe9, especially id property:

          • Persistence/Cache is treating UrlAlias->id as unique, like a id normally is, and same is the case in database schema PRIMARY KEY (`parent`,`text_md5`), which is essentially the value exposed as UrlAlias->id
          • Persistence/Legacy UrlAlias Handler seems to mix this up in certain cases, at least lookup($url) when url is a history url, making it in this case return a history element but with wrong id, causing cache to wrongly place this in it's cache (specifically loadUrlAliasData loads all levels up to root, and returns the root, but with is_path_history/isHistory and raw_path_data/pathData overwritten with the historical data), so a different object then when loading by id.
          Show
          André Rømcke added a comment - - edited For users looking for a fix for this right now apply 1798 , or revert 18cfe9 which surfaced this issue in the first place. However the issue goes deeper internally so we will iterate a bit more to fix it the right way. Investigation/discussion so far in #1798 has reveled that there is an inconsistency somewhere in regards to UrlAlias SPI objects, which is made visible by 18cfe9, especially id property: Persistence/Cache is treating UrlAlias->id as unique, like a id normally is, and same is the case in database schema PRIMARY KEY (`parent`,`text_md5`) , which is essentially the value exposed as UrlAlias->id Persistence/Legacy UrlAlias Handler seems to mix this up in certain cases, at least lookup($url) when url is a history url, making it in this case return a history element but with wrong id, causing cache to wrongly place this in it's cache (specifically loadUrlAliasData loads all levels up to root, and returns the root, but with is_path_history / isHistory and raw_path_data / pathData overwritten with the historical data) , so a different object then when loading by id.
          Hide
          Bertrand Dunogier added a comment -

          Closed the PR above as it just scratched the symptoms.

          See https://gist.github.com/bdunogier/e55ccc1eafda264dc5abb8ee1de3d394 for a command script reproducing the issue, that can be a good base for an integration test.

          Show
          Bertrand Dunogier added a comment - Closed the PR above as it just scratched the symptoms. See https://gist.github.com/bdunogier/e55ccc1eafda264dc5abb8ee1de3d394 for a command script reproducing the issue, that can be a good base for an integration test.
          Show
          Petar Spanja (Inactive) added a comment - Pull request: https://github.com/ezsystems/ezpublish-kernel/pull/1821
          Show
          Petar Spanja (Inactive) added a comment - Merged to 6.5 , 6.6 and master in https://github.com/ezsystems/ezpublish-kernel/commit/4317000b30ca745578759393301e5750f68ac1c4
          Hide
          Miguel das Neves Jacinto (Inactive) added a comment -

          QA Approved

          Show
          Miguel das Neves Jacinto (Inactive) added a comment - QA Approved

            People

            • Assignee:
              Unassigned
              Reporter:
              Jani Tarvainen
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: