[TASK] Improved slug generation for translated pages 10/58010/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 23 Aug 2018 18:34:11 +0000 (20:34 +0200)
committerBenni Mack <benni@typo3.org>
Thu, 23 Aug 2018 19:44:01 +0000 (21:44 +0200)
If a slug is generated for a nested translated page that
has a not translated page up in its rootline, the slug
generator now considers the default language page instead
of not including the upper tree pages at all.

Change-Id: Id5b4d3b1b815124413919bc8b48e03f2785573d9
Resolves: #85952
Releases: master
Reviewed-on: https://review.typo3.org/58010
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Richard Haeser <richard@maxserv.com>
Tested-by: Richard Haeser <richard@maxserv.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/DataHandling/SlugHelper.php

index 1f2c7dd..e5974f9 100644 (file)
@@ -144,9 +144,9 @@ class SlugHelper
             $rootLine = BackendUtility::BEgetRootLine($pid, '', true, ['nav_title']);
             $parentPageRecord = reset($rootLine);
             if ($languageId > 0) {
-                $parentPageRecord = BackendUtility::getRecordLocalization('pages', $parentPageRecord['uid'], $languageId);
-                if (!empty($parentPageRecord)) {
-                    $parentPageRecord = reset($parentPageRecord);
+                $localizedParentPageRecord = BackendUtility::getRecordLocalization('pages', $parentPageRecord['uid'], $languageId);
+                if (!empty($localizedParentPageRecord)) {
+                    $parentPageRecord = reset($localizedParentPageRecord);
                 }
             }
             if (is_array($parentPageRecord)) {