[BUGFIX] Ensure slug update wizard uses proper sorting 53/58153/2
authorBenni Mack <benni@typo3.org>
Mon, 3 Sep 2018 19:06:22 +0000 (21:06 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 3 Sep 2018 21:04:49 +0000 (23:04 +0200)
If two subpages share the same name, it is important, that the first
page gets a proper name, and the second one follows the uniqueInSite pattern.

Also, sorting by workspaces (live first), PID and then sorting seems to be
just logical. I wonder why I did not add this before.

Resolves: #86120
Releases: master
Change-Id: I53f279034c2c61a31b50fc973721827f0c2685ba
Reviewed-on: https://review.typo3.org/58153
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/install/Classes/Updates/PopulatePageSlugs.php

index a1b2be5..91e63ef 100644 (file)
@@ -100,6 +100,11 @@ class PopulatePageSlugs extends AbstractUpdate
             )
             // Ensure that fields with alias are managed first
             ->orderBy('alias', 'desc')
+            // Ensure that live workspace records are handled first
+            ->addOrderBy('t3ver_wsid', 'asc')
+            // Ensure that all pages are run through "per parent page" field, and in the correct sorting values
+            ->addOrderBy('pid', 'asc')
+            ->addOrderBy('sorting', 'asc')
             ->execute();
 
         // Check for existing slugs from realurl