Project

General

Profile

Actions

Bug #87369

closed

Slug generation does not work for readonly fields

Added by Michael Grundkötter almost 6 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2019-01-08
Due date:
% Done:

0%

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

Description

When configuring a TCA type "slug", using a "field" in "generatorOptipons" with readOnly=true set in TCA, this field is not used/skipped in the slug generation process.
E.g. this TCA

'title' => [
     'exclude' => true,
     'label' => 'LLL:EXT:xyz/Resources/Private/Language/locallang_db.xlf:tx_xyz_domain_model_offer.title',
     'config' => [
         'type' => 'input',
         'size' => 30,
         'eval' => 'trim,required'
     ],
],
'webcode' => [
   'exclude' => true,
   'label' => 'LLL:EXT:xyz/Resources/Private/Language/locallang_db.xlf:tx_xyz_domain_model_offer.webcode',
   'config' => [
       'type' => 'input',
       'readOnly' => true,
       'size' => 4,
       'eval' => 'unique,int',
       'range' => [
           'lower' => 1000,
           'upper' => 9999
       ]
   ],
],
'slug' => [
   'exclude' => true,
   'label' => 'LLL:EXT:xyz/Resources/Private/Language/locallang_db.xlf:tx_xyz_domain_model_offer.slug',
   'config' => [
       'type' => 'slug',
       'fallbackCharacter' => '-',
       'size' => 50,
       'eval' => 'uniqueInSite',
       'generatorOptions' => [
           'fields' => ['title', 'webcode'],
           'fieldSeparator' => '-',
           'prependSlash' => true,
           'prefixParentPageSlug' => true,
           'replacements' => [
               '/' => '',
           ],
       ]
   ],
],

The title field is used correctly, the webcode field is skipped. When I remove the readonly flag on webcode, the slug is generated correctly.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #104178: Slug Creation skips field if set to readOnlyClosed2024-06-21

Actions
Related to TYPO3 Core - Bug #90141: Slug recreation is not availabe for generator fields that are configured as "readonly"Closed2020-01-17

Actions
Actions #1

Updated by Benjamin Gries Gries almost 6 years ago

I can confirm this. The value of the input field can't be read in SlugElement.js, because the readOnly option adds a disabled attribute instead of a readonly attribute to the input field. This has potentially an influence to all input fields where the readOnly option is used.

Actions #2

Updated by Benjamin Gries Gries almost 6 years ago

  • Category set to Site Handling, Site Sets & Routing
Actions #3

Updated by Rémy DANIEL about 4 years ago

The issue exists on a localized record with a field which is configured to be l10n_mode=exclude.
The slug of the localized record will not contain the excluded field.
It should contain the default language's value of the excluded field.

Actions #4

Updated by Georg Ringer 5 months ago

  • Status changed from New to Closed

closed in favor of #90141 and #104178

Actions #5

Updated by Georg Ringer 5 months ago

  • Related to Bug #104178: Slug Creation skips field if set to readOnly added
Actions #6

Updated by Georg Ringer 5 months ago

  • Related to Bug #90141: Slug recreation is not availabe for generator fields that are configured as "readonly" added
Actions

Also available in: Atom PDF