[BUGFIX] Make nested slugs in rootpages possible 90/59390/4
authorBenni Mack <benni@typo3.org>
Wed, 9 Jan 2019 16:02:58 +0000 (17:02 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 11 Jan 2019 17:03:52 +0000 (18:03 +0100)
If there are nested sites, the rootpage of the
nested site cannot have the slug "/" as the uniqueInSite
evaluates against the parent page, and not the actual
page.

Instead of taking the PID of the parent page ID, the uid
of the localized record is used.

Resolves: #87404
Releases: master, 9.5
Change-Id: Idab821cae57fe72b01f5b4beef80341db4273fc8
Reviewed-on: https://review.typo3.org/59390
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Daniel Gorges <daniel.gorges@b13.de>
Tested-by: Daniel Gorges <daniel.gorges@b13.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Classes/DataHandling/SlugHelper.php
typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/PlainScenario.yaml

index d94feff..96537f4 100644 (file)
@@ -250,7 +250,7 @@ class SlugHelper
      */
     public function isUniqueInSite(string $slug, RecordState $state): bool
     {
-        $pageId = (int)$state->resolveNodeIdentifier();
+        $pageId = (int)$state->resolveNodeAggregateIdentifier();
         $recordId = $state->getSubject()->getIdentifier();
         $languageId = $state->getContext()->getLanguageId();
 
index 7a0f4a7..6a83d5b 100644 (file)
@@ -69,12 +69,12 @@ entities:
         - self: {id: 1200, title: 'EN: Features'}
           children:
             - self: {id: 1210, title: 'EN: Frontend Editing'}
-        - self: {id: 1300, title: 'EN: Products', root: true}
+        - self: {id: 1300, title: 'EN: Products'}
           children:
             - self: {id: 1310, title: 'EN: Planets'}
             - self: {id: 1320, title: 'EN: Spaceships'}
             - self: {id: 1330, title: 'EN: Dark Matter'}
-        - self: {id: 1400, title: 'EN: ACME in your Region', root: true}
+        - self: {id: 1400, title: 'EN: ACME in your Region'}
           languageVariants:
             - self: {id: 1401, title: 'FR: ACME in your Region', language: 1}
             - self: {id: 1402, title: 'FR-CA: ACME in your Region', language: 2}