Project

General

Profile

Actions

Bug #87884

closed

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

Added by Soren Malling about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Link Handling, Site Handling & Routing
Target version:
Start date:
2019-03-11
Due date:
% Done:

100%

Estimated time:
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


Files


Related issues 2 (1 open1 closed)

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

Actions
Related to TYPO3 Core - Bug #86727: Numeric in slugs on multidomain instances.Closed2018-10-24

Actions
Actions #1

Updated by Soren Malling about 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

Actions #2

Updated by Guido Schmechel about 5 years ago

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

Updated by Oliver Hader about 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.

Actions #5

Updated by Oliver Hader about 5 years ago

  • Status changed from New to Needs Feedback
Actions #6

Updated by Soren Malling about 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

Actions #7

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

Actions #8

Updated by Oliver Hader about 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...

Actions #9

Updated by Dmitry Dulepov about 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.

Actions #10

Updated by Rony Khoury about 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.

Actions #11

Updated by Oliver Hader about 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)
Actions #12

Updated by Dmitry Dulepov about 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.

Actions #13

Updated by Riccardo De Contardi almost 5 years ago

  • Category set to Link Handling, Site Handling & Routing
Actions #14

Updated by Benni Mack almost 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"

Actions #15

Updated by Gerrit Code Review almost 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

Actions #16

Updated by Gerrit Code Review almost 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

Actions #17

Updated by Gerrit Code Review almost 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

Actions #18

Updated by Gerrit Code Review almost 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

Actions #19

Updated by Gerrit Code Review almost 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

Actions #20

Updated by Gerrit Code Review almost 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

Actions #21

Updated by Benni Mack almost 5 years ago

  • Target version set to next-patchlevel
Actions #22

Updated by Riccardo De Contardi almost 5 years ago

  • Related to Bug #86727: Numeric in slugs on multidomain instances. added
Actions #23

Updated by Gerrit Code Review almost 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

Actions #24

Updated by Gerrit Code Review almost 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

Actions #25

Updated by Gerrit Code Review almost 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

Actions #26

Updated by Benni Mack almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #27

Updated by Gerrit Code Review almost 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

Actions #28

Updated by Benni Mack almost 5 years ago

  • Status changed from Under Review to Resolved
Actions #29

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF