Bug #87884
closedRoot page of page tree suddenly gets slug "/1"
100%
Description
This is a issue created for Benni Mack to follow up on a Slack conversation
https://typo3.slack.com/archives/C2ZKN8P7G/p1551805852037400
Files
Updated by Soren Malling over 5 years ago
In some cases the root page gets the slug "/1" after editing page properties and sometimes without doing so. The screenshot contains the communication from Slack
Updated by Guido Schmechel over 5 years ago
- Related to Bug #87454: Slug/URL segment - /1 is wrongly saved, when trying to set / on rootpage. added
Updated by Benni Mack over 5 years ago
Just hard for me to reproduce this issue currently with latest master / 9.5.x-dev
Updated by Oliver Hader over 5 years ago
SELECT uid, pid, slug, t3ver_state, sys_language_uid, l10n_parent FROM pages WHERE (slug = '/') AND (uid <> [PAGE-ID]) AND (sys_language_uid = 0) AND (t3ver_wsid IN (0)) AND (pid <> -1) AND (pages.deleted = 0)
Please execute the following SQL statement, replace PAGE-ID
with the page that you have been modified and post the results.
For each of the results, please add the name or root-page uid of the according site configuration as well.
Updated by Oliver Hader over 5 years ago
- Status changed from New to Needs Feedback
Updated by Soren Malling over 5 years ago
SELECT uid, pid, slug, t3ver_state, sys_language_uid, l10n_parent FROM pages WHERE (slug = '/') AND (uid <> 1) AND (sys_language_uid = 0) AND (t3ver_wsid IN (0)) AND (pid <> -1) AND (pages.deleted = 0)
uid 1 is the root page of www.meteko.dk. The returned result is the following
{
"data":
[
{
"uid": 2,
"pid": 0,
"slug": "/",
"t3ver_state": 0,
"sys_language_uid": 0,
"l10n_parent": 0
},
{
"uid": 14,
"pid": 1,
"slug": "/",
"t3ver_state": 0,
"sys_language_uid": 0,
"l10n_parent": 0
}
]
}
Page uid 2 is a different pagetree from a different (not active site). "lejrguide" (as the site is called) is having rootPageId: 2 in it's config file
Page uid 14 is a separator page used for visualising a split in my page tree.
What is not returned is the actual page (uid=1) where the issue occured and neither is a translated version of the uid=1 (expected since we only look for sys_language_uid = 1
Updated by Soren Malling over 5 years ago
Just pasting the findings me and Oliver found during a walkthrough of the issue.
Here is what came to my mind during the chat.
I have been doing a lot lately with `.disabled = 1` on a number of fields. I found out (when localizing content) that the sys_language_uid wasn’t saved becuase i had disabled it. I might have, in a early stage of the page, disabled the `slug` field, because it’s not a “editor” thing to work with that. And since that, the slug was never created for some pages and there “empty” or “/” untill i reactivated the `slug` field
For this reason I had a "divider" page created as a moment in time where the slug field was disabled, and therefore never filled (or given "/"). So, later when I re-enabled the slug field and went to page properties of my page, changed the title and clicked "save", the SlugHelper found out that "/" was already taken and then gave the frontpage "/1" which is the uid of the page.
Updated by Oliver Hader over 5 years ago
- Status changed from Needs Feedback to Accepted
Thanks Søren, disabled or not visible slug
fields are the key aspect here! Thanks for that valuable input!
In those scenarios the value will be empty... no auto-generation...
Updated by Dmitry Dulepov over 5 years ago
Slug was not disabled in our case. The page inside the root page was created as hidden. It got `/` as a slug. So the slug on the home page got `/1` because it must be unique within the site.
Updated by Rony Khoury over 5 years ago
In my case, the slug was not disabled. I accidentally created a new sys-folder outside the page-tree by dropping it after the page-tree (PID of sys-folder is 0). The sys-folder got the slug "/". I then moved the sys-folder inside the page-tree. The slug of the sys-folder is still "/". When you edit the root-page properties and hit "save", the slug of the root-page changes to "/1". Only after changing the slug of the sys-folder, I was able to set the correct slug for the root-page.
Updated by Oliver Hader over 5 years ago
In terms of actions items that means:
- when creating new records having a slug field configured in $TCA, generate slug value in case it's not defined in the incomingFieldValue in
DataHandler
- when moving a record having a slug field configured in $TCA to a different page, ensure that slug value is unique in the new scenario (page or site) in
DataHandler
(maybe a move command hook)
Updated by Dmitry Dulepov over 5 years ago
I'd say the slug of a new or moved page should change to '/1', not the slug of the root page.
Updated by Riccardo De Contardi over 5 years ago
- Category set to Site Handling, Site Sets & Routing
Updated by Benni Mack over 5 years ago
This is how I could reproduce this issue:
- Create a root page with site configuration
- Create a second root page without site configuration
- Move second page into first page
- Second page has "/", First page has "/"
- Now edit first page and "/1" is added.
This is due to the fact that DataHandler->moveRecord_raw() does not consider "uniqueInSite"
Updated by Gerrit Code Review over 5 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60534
Updated by Gerrit Code Review over 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60534
Updated by Gerrit Code Review over 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60534
Updated by Gerrit Code Review over 5 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60534
Updated by Gerrit Code Review over 5 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60534
Updated by Gerrit Code Review over 5 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60534
Updated by Riccardo De Contardi over 5 years ago
- Related to Bug #86727: Numeric in slugs on multidomain instances. added
Updated by Gerrit Code Review over 5 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60534
Updated by Gerrit Code Review over 5 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60534
Updated by Gerrit Code Review over 5 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60534
Updated by Benni Mack over 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 67eddfc1b436ed2d829beb3e490c59e1823ff641.
Updated by Gerrit Code Review over 5 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60686
Updated by Benni Mack over 5 years ago
- Status changed from Under Review to Resolved
Applied in changeset 20e303a21cfe1f0e76cc8e4e285eb70f333738ec.