[BUGFIX] Call `TBE_EDITOR.fieldChanged()` again
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 11 May 2021 15:40:20 +0000 (17:40 +0200)
committerDaniel Goerz <daniel.goerz@posteo.de>
Tue, 11 May 2021 16:50:00 +0000 (18:50 +0200)
With #93975 the calls to `TBE_EDITOR.fieldChanged()` as onchange handlers
have been removed which was an accidental breaking change.
This patch adds the necessary calls again, which may lead to false
deprecation warnings in the browser's console.

Resolves: #94108
Related: #93975
Releases: master
Change-Id: Ifbae4adb0ff8b931bbdb3fe4d08c14c5aa30f81f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69107
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
typo3/sysext/backend/Classes/Controller/FormFlexAjaxController.php
typo3/sysext/backend/Classes/Form/Container/SingleFieldContainer.php

index e09014f..d34e5e3 100644 (file)
@@ -126,6 +126,12 @@ class FormFlexAjaxController extends AbstractFormEngineAjaxController
         // JavaScript code for event handlers:
         // @todo: see if we can get rid of this - used in group elements, and also for the "reload" on type field changes
         $formData['parameterArray']['fieldChangeFunc'] = [];
+        $formData['parameterArray']['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] = 'TBE_EDITOR.fieldChanged('
+            . GeneralUtility::quoteJSvalue($tableName)
+            . ',' . GeneralUtility::quoteJSvalue($formData['databaseRow']['uid'])
+            . ',' . GeneralUtility::quoteJSvalue($fieldName)
+            . ',' . GeneralUtility::quoteJSvalue($formData['parameterArray']['itemFormElName'])
+            . ');';
 
         // @todo: check GroupElement for usage of elementBaseName ... maybe kick that thing?
 
index 8f13b71..79a7fc7 100644 (file)
@@ -119,6 +119,12 @@ class SingleFieldContainer extends AbstractContainer
 
         // JavaScript code for event handlers:
         $parameterArray['fieldChangeFunc'] = [];
+        $parameterArray['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] = 'TBE_EDITOR.fieldChanged('
+            . GeneralUtility::quoteJSvalue($table) . ','
+            . GeneralUtility::quoteJSvalue($row['uid']) . ','
+            . GeneralUtility::quoteJSvalue($fieldName) . ','
+            . GeneralUtility::quoteJSvalue($parameterArray['itemFormElName'])
+            . ');';
 
         // Based on the type of the item, call a render function on a child element
         $options = $this->data;