Skip to content

Commit

Permalink
[BUGFIX] Respect hidden fields for slug regeneration
Browse files Browse the repository at this point in the history
To regenerate a slug, the fields defined in
the TCA "generatorOptions" configuration have
to be present in the form.

There are cases where those fields are added as
hidden fields (e.g. using the "overrideValues"
feature). Those fields are now also properly
respected for the regeneration.

Resolves: #103500
Releases: main, 12.4
Change-Id: I0ca7de4b7d7d09e62ece511aeb16615af3d3a1fa
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83657
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
o-ba committed Apr 4, 2024
1 parent 332a306 commit 2dac724
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -219,8 +219,8 @@ class SlugElement {
for (const [fieldName, selector] of Object.entries(this.fieldsToListenOn)) {
let field = document.querySelector('[data-formengine-input-name="' + selector + '"]') as HTMLElement;
if (field === null) {
// Also check for select fields, which do not point to a hidden input field
field = document.querySelector('select[name="' + selector + '"]') as HTMLElement;
// Also check for fields, which do not point to a hidden input field (e.g. "input type=hidden" or select fields)
field = document.querySelector('[name="' + selector + '"]') as HTMLElement;
}
if (field !== null) {
availableFields[fieldName] = field;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2dac724

Please sign in to comment.