Bug #90141
closedSlug recreation is not availabe for generator fields that are configured as "readonly"
100%
Description
When the generator field of a slug configuration has the TCA option "readonly" the Slug recreation button is disabled, even though the recreation is possible if started programmatically.
Example:
Have a fairly standard slug field config:
'config' => [
'type' => 'slug',
'generatorOptions' => [
'fields' => ['title'],
'fieldSeparator' => '/',
'prefixParentPageSlug' => true,
'replacements' => [
'/' => '-',
],
],
'fallbackCharacter' => '-',
'eval' => 'uniqueInSite'
]
And the title field, that is readonly (e.g. if the title is provided by an external service):
'title' => [
'label' => 'Title',
'config' => [
'type' => 'input',
'readOnly' => true
],
],
The problem seems to be in the Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngine/Element/SlugElement.ts on Line 211.
The selector only considers [data-formengine-input-name="' + field + '"] as a valid source field, while the readonly input fields don't have those data-Attributes.
In my opinion the disabled-State of the recreate-Button should not be dependent on the state of GUI-Elements. For example if no valid generator fields are configured there still might be postModifiers Hooks that will return a slug eventually.
Basically the same underlying issue as in https://forge.typo3.org/issues/89187 but the patch on that issue will not work for this one.