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

ezplatform:urls:regenerate-aliases changes parent of broken link

    XMLWordPrintable

    Details

      Description

      When repairing old url aliases (redirecting to current one), if there are a few of them under different parents, they're all attached to the parent of the current entry. What should be repaired is just a link to the current alias.

      Steps to reproduce

      1. Create clean eZ Platform instance
      2. Create and publish folder named "folder"
      3. Inside that folder create and publish another folder also named "folder"
      4. Modify that newly created and published folder - update name to "folder2". Publish the change.
      5. Move the "folder2" up to eZ Platform root, so it's on the same level as the folder created in the pt 2.
      6. Observe that /folder/folder redirects you to /folder2
      7. Break archived ezurlalias_ml record for "folder2" (which was called "folder") entry by modifying and executing the following query:
        UPDATE ezurlalias_ml SET link = 666 WHERE action = "eznode:<FOLDER2_LOCATION_ID>" and is_original = 0 and text = 'folder';
      8. Clear Symfony cache
      9. Execute the ezplatform:urls:regenerate-aliases command
      10. Clear Symfony cache

      Actual result

      1. Script when processing data displays warning "Failed processing location ... - Folder2 (eZ\Publish\Core\Base\Exceptions\BadStateException: Argument 'locationId' has a bad state: Database error)"
      2. The front-end location /folder/folder no longer redirects you to /folder2, instead there's 404.
      3. Archived database entry for "folder2" location (called "folder") got removed from ezurlalias_ml table.

      Expected result

      1. Script goes smoothly w/o warnings and errors.
      2. The front-end location /folder/folder redirects you to /folder2
      3. Archived database entry for "folder2" location (called "folder") still exists and its link column value has been repaired.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              andrzej.longosz@ez.no Andrzej Longosz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 6 hours, 30 minutes
                  1d 6h 30m