Commit 82958e39 authored by Oliver Hader's avatar Oliver Hader Committed by Oliver Hader
Browse files

[TASK] Get rid of deprecated TBE_EDITOR.fieldChanged invocation

Substitutes deprecated invocation of `TBE_EDITOR.fieldChanged`.
Relevant processing has been duplicated from `TBE_EDITOR` to
corresponding `FormEngine` event handler. Throwing a new `change`
event from a `change` event handler is counterproductive and would
lead to an endless loop.

Resolves: #95352
Releases: master
Change-Id: I61daee4457ec5d2bb36d1bcc773178c25e00cb8e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71229

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
parent c0ad882c
......@@ -53,8 +53,16 @@ define(['jquery',
// @see \TYPO3\CMS\Backend\Form\Behavior\UpdateValueOnFieldChange
onFieldChangeHandlers.set('typo3-backend-form-update-value', (data, evt) => {
// @todo TBE_EDITOR is deprecated but still used on core...
TBE_EDITOR.fieldChanged.call(null, data.tableName, data.identifier, data.fieldName, data.elementName);
const valueField = document.querySelector('[name="' + CSS.escape(data.elementName) + '"]');
const humanReadableField = document.querySelector('[data-formengine-input-name="' + CSS.escape(data.elementName) + '"]');
FormEngineValidation.updateInputField(data.elementName);
if (valueField !== null) {
FormEngineValidation.markFieldAsChanged(valueField);
FormEngineValidation.validateField(valueField);
}
if (humanReadableField !== null && humanReadableField !== valueField) {
FormEngineValidation.validateField(humanReadableField);
}
});
// @see \TYPO3\CMS\Backend\Form\Behavior\ReloadOnFieldChange
onFieldChangeHandlers.set('typo3-backend-form-reload', (data, evt) => {
......
......@@ -564,6 +564,9 @@ define([
if (field instanceof $) {
field = field.get(0);
}
if (!(field instanceof HTMLElement)) {
return;
}
const paletteField = field.closest('.t3js-formengine-palette-field');
paletteField.classList.add('has-change');
};
......
Markdown is supported
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