Bug #90141

Slug recreation is not availabe for generator fields that are configured as "readonly"

Added by David Rellstab 4 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
-
Start date:
2020-01-17
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues

Related to TYPO3 Core - Bug #89187: Slug recreation is not available for generator fields with type=inline Under Review 2019-09-17

Associated revisions

Revision 71535a11 (diff)
Added by Andreas Fernandez 2 months ago

[BUGFIX] Set `data-formengine-input-name` for disabled text fields

Disabled input fields now contain the `data-formengine-input-name`
attribute. The slug creation is now able to determine disabled fields as
well to take them into consideration.

Resolves: #90141
Releases: master, 9.5
Change-Id: I153a2d8e3e3e67fd6d865bd4e72691c67ab18c3e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63947
Tested-by: Frank Nägler <>
Tested-by: TYPO3com <>
Tested-by: Georg Ringer <>
Reviewed-by: Frank Nägler <>
Reviewed-by: Georg Ringer <>

Revision 2179282c (diff)
Added by Andreas Fernandez 2 months ago

[BUGFIX] Set `data-formengine-input-name` for disabled text fields

Disabled input fields now contain the `data-formengine-input-name`
attribute. The slug creation is now able to determine disabled fields as
well to take them into consideration.

Resolves: #90141
Releases: master, 9.5
Change-Id: I153a2d8e3e3e67fd6d865bd4e72691c67ab18c3e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63906
Tested-by: TYPO3com <>
Tested-by: Georg Ringer <>
Reviewed-by: Georg Ringer <>

History

#1 Updated by David Rellstab 4 months ago

  • Related to Bug #89187: Slug recreation is not available for generator fields with type=inline added

#2 Updated by Gerrit Code Review 2 months 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/+/63947

#3 Updated by Gerrit Code Review 2 months 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/+/63947

#4 Updated by Gerrit Code Review 2 months 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/+/63947

#5 Updated by Gerrit Code Review 2 months 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/+/63906

#6 Updated by Andreas Fernandez 2 months ago

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

#7 Updated by Benni Mack about 2 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF