Details
-
Bug
-
Resolution: Fixed
-
High
-
2.3.0, 2.4.0
-
None
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
- Create clean eZ Platform instance
- Create and publish folder named "folder"
- Inside that folder create and publish another folder also named "folder"
- Modify that newly created and published folder - update name to "folder2". Publish the change.
- Move the "folder2" up to eZ Platform root, so it's on the same level as the folder created in the pt 2.
- Observe that /folder/folder redirects you to /folder2
- 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';
- Clear Symfony cache
- Execute the ezplatform:urls:regenerate-aliases command
- Clear Symfony cache
Actual result
- Script when processing data displays warning "Failed processing location ... - Folder2 (eZ\Publish\Core\Base\Exceptions\BadStateException: Argument 'locationId' has a bad state: Database error)"
- The front-end location /folder/folder no longer redirects you to /folder2, instead there's 404.
- Archived database entry for "folder2" location (called "folder") got removed from ezurlalias_ml table.
Expected result
- Script goes smoothly w/o warnings and errors.
- The front-end location /folder/folder redirects you to /folder2
- Archived database entry for "folder2" location (called "folder") still exists and its link column value has been repaired.