#94655Slug generation for records with pid=0 always returns "/"
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
- 10.4 72257[BUGFIX] Ignore prefixParentPageSlug for non-page record in SlugHelper
- 11.5 72256[BUGFIX] Ignore prefixParentPageSlug for non-page record in SlugHelper
- main 72168[BUGFIX] Ignore prefixParentPageSlug for non-page record in SlugHelper
- main 70122[BUGFIX] Fix slug generation for non-pages records with pid=0
- 10.4 71059[BUGFIX] Fix slug generation for non-pages records with pid=0