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

RegenerateUrlAliasesCommand sometimes generates alias with wrong parent (0)

    XMLWordPrintable

    Details

      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

      1. Create new eZ Platform installation.
      2. Add the following line to your app/AppKernel.php file:
        new eZ\Bundle\EzPublishMigrationBundle\EzPublishMigrationBundle(),
        
      3. In your database, create the table named __migration_ezurlalias_ml which should be identical (but empty) as ezurlalias_ml table.
      4. Under root "eZ Platform" Content create a new Article named "Child".
      5. Under root "eZ Platform" Content create a new Folder named "Parent" (note: order of these steps is important).
      6. Move the "Child" Content Object, selecting "Parent" as its parent location.
      7. Run the following command from the console:
        php app/console ezplatform:regenerate:legacy_storage_url_aliases full
        
      8. 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

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jacek.foremski-obsolete@ez.no Jacek Foremski (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: