Bug #87884

Root page of page tree suddenly gets slug "/1"

Added by Soren Malling 9 days ago. Updated 6 days ago.

Status:
Accepted
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2019-03-11
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

This is a issue created for Benni Mack to follow up on a Slack conversation

https://typo3.slack.com/archives/C2ZKN8P7G/p1551805852037400

Screen-Shot-2019-03-11-at-15.36.54.png View (682 KB) Soren Malling, 2019-03-11 15:37


Related issues

Related to TYPO3 Core - Bug #87454: Slug/URL segment - /1 is wrongly saved, when trying to set / on rootpage. New 2019-01-16

History

#1 Updated by Soren Malling 9 days 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

#2 Updated by Guido Schmechel 8 days ago

  • Related to Bug #87454: Slug/URL segment - /1 is wrongly saved, when trying to set / on rootpage. added

#4 Updated by Oliver Hader 8 days 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.

#5 Updated by Oliver Hader 8 days ago

  • Status changed from New to Needs Feedback

#6 Updated by Soren Malling 7 days 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

#7 Updated by Soren Malling 7 days 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.

#8 Updated by Oliver Hader 7 days 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...

#9 Updated by Dmitry Dulepov 7 days 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.

#10 Updated by Rony Khoury 7 days 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.

#11 Updated by Oliver Hader 7 days 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)

#12 Updated by Dmitry Dulepov 6 days ago

I'd say the slug of a new or moved page should change to '/1', no the slug of the root page.

Also available in: Atom PDF