Bug #89560
closedInputSlugElement cannot use 'uid' for slug suggestion Ajax request
100%
Description
When we have a slug field that is defined to use the uid and e.g. the name of a record for generating a slug, the refresh button does not work.
Example TCA configuration:
'slug' => [
'label' => 'slug',
'config' => [
'type' => 'slug',
'size' => 128,
'generatorOptions' => [
'fields' => ['name', 'uid'],
'fieldSeparator' => '-',
'replacements' => [
'/' => '-'
],
],
'fallbackCharacter' => '-',
'eval' => 'uniqueInPid',
'default' => ''
]
]
This configuration is valid and produces the correct result when the slug field is cleared and automatically filled by the DataHandler upon saving.
Using the refresh button does not work however. The SlugElement TS/JS searches for FormEngine input fields and adds the values of those to its request.
The uid however is not a FormEngine input field and therefore cannot be read and added to the fields that are used to generate the slug.
Two workarounds are known. But they come with lots of problems.
1.
Telling editors to clear the field instead of using the refresh button (as they are used to from pages).
This works but is a burden upon the editors and there will surely be some who use the refresh button anyway, resulting in "wrong"/inconsistent slugs.
2.
Adding the uid as a FormEngine input field. This allows the SlugElement.ts/js to read the uid value, as long as it is not set to read only.
Even when hidden by put into a hidden palette, it can still be manipulated and break everything.
Of course the SlugElement.ts/js does know about the uid, so it should be a simple thing to add it to the values sent to the FormSlugAjaxController.
Updated by Gerrit Code Review about 5 years ago
- Status changed from New 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/+/62170
Updated by Gerrit Code Review about 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/+/62170
Updated by Gerrit Code Review about 5 years ago
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/+/62263
Updated by Anonymous about 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 29af6f5cbe9806786fbaa47856201c91ab794bf3.