Commit f8088b41 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Prevent JavaScript error on changing single option group fields

A check in the FormEngine JavaScript component
is fixed, preventing a corresponding error when
changing the value of a single option group field,
e.g. the "content_from_pid" field in pages.

Additionally, a wrong selector, leading to a
ReferenceError, is fixed as well.

Resolves: #97342
Related: #95137
Releases: main, 11.5
Change-Id: I8c27f9ee4eddb032ec51ef66db99da3bf3c5a8d3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74253

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent bc4093af
...@@ -165,8 +165,8 @@ define(['jquery', ...@@ -165,8 +165,8 @@ define(['jquery',
// If multiple values are not allowed, clear anything that is in the control already // If multiple values are not allowed, clear anything that is in the control already
if (!isMultiple) { if (!isMultiple) {
$fieldEl.find('option').each(function() { $fieldEl.find('option').each(function() {
const $option = $availableFieldEl.find('option[value="' + $.escapeSelector($(el).attr('value')) + '"]'); const $option = $availableFieldEl.find('option[value="' + $.escapeSelector($(this).attr('value')) + '"]');
if ($option) { if ($option.length) {
$option.removeClass('hidden').prop('disabled', false); $option.removeClass('hidden').prop('disabled', false);
FormEngine.enableOptGroup($option.get(0)); FormEngine.enableOptGroup($option.get(0));
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment