Details
-
Bug
-
Resolution: Fixed
-
High
-
1.7.6, 1.13.0, 2.0.0
Description
RegenerateUrlAliasesCommand sometimes tries to create aliases for child nodes before their parent alias is created. This results in "0" being written in the parent column. "0" is also an id representing the root Content, which causes malfunction.
This error is caused by the wrong function used here: https://github.com/ezsystems/ezpublish-kernel/blob/0775dabba4f0cbb0a1402371e170b5436a5dc41e/eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/RegenerateUrlAliasesCommand.php#L589 (should be addOrderBy instead of orderBy because currently it overrides previous setting).
Steps to reproduce
- Create new eZ Platform installation.
- Add the following line to your app/AppKernel.php file:
new eZ\Bundle\EzPublishMigrationBundle\EzPublishMigrationBundle(),
- In your database, create the table named __migration_ezurlalias_ml which should be identical (but empty) as ezurlalias_ml table.
- Under root "eZ Platform" Content create a new Article named "Child".
- Under root "eZ Platform" Content create a new Folder named "Parent" (note: order of these steps is important).
- Move the "Child" Content Object, selecting "Parent" as its parent location.
- Run the following command from the console:
php app/console ezplatform:regenerate:legacy_storage_url_aliases full
- Inspect the __migration_ezurlalias_ml table. There will be a row where text="Child". Currently, in this row, parent equals 0. Instead, it should equal id of "Parent"'s url alias.
Attachments
Issue Links
- relates to
-
EZP-28741 RegenerateUrlAliasesCommand should report an error if the parent is missing
- Confirmed