Project

General

Profile

Actions

Bug #89560

closed

InputSlugElement cannot use 'uid' for slug suggestion Ajax request

Added by Johannes Schlier over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-10-31
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

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.

Actions #1

Updated by Gerrit Code Review over 4 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

Actions #2

Updated by Gerrit Code Review over 4 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

Actions #3

Updated by Gerrit Code Review over 4 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

Actions #4

Updated by Anonymous over 4 years ago

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

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF