Issue Bug Closed

#94655Slug generation for records with pid=0 always returns "/"

Rudy Gnodde 07/28/21, 09:54 updated 10/07/21, 07:15

Description

I’ve added a slug field to records that have pid=0. The generated slug is always /. The cause for this is a hardcoded check in the generate function in TYPO3\CMS\Core\DataHandling\SlugHelper:

if ($pid === 0 || (!empty($recordData['is_siteroot']) && $this->tableName === 'pages')) {
    return '/';
}

The check for pid=0 makes sense for pages, but not for other record types.

I’ve checked this in TYPO3 10 and 11.

Reviews 5