diff --git a/typo3/sysext/backend/Classes/Form/FormResultCompiler.php b/typo3/sysext/backend/Classes/Form/FormResultCompiler.php index 9299f116cdc7956e6c6c72741e24a739a85bbcdf..ef30cfa5820f048ebedcebbc768d097b4c42b5a2 100644 --- a/typo3/sysext/backend/Classes/Form/FormResultCompiler.php +++ b/typo3/sysext/backend/Classes/Form/FormResultCompiler.php @@ -216,10 +216,8 @@ class FormResultCompiler // load the main module for FormEngine with all important JS functions $this->requireJsModules['TYPO3/CMS/Backend/FormEngine'] = 'function(FormEngine) { FormEngine.setBrowserUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('wizard_element_browser')) . '); - }'; - $this->requireJsModules['TYPO3/CMS/Backend/FormEngineValidation'] = 'function(FormEngineValidation) { - FormEngineValidation.setUsMode(' . ($GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? '1' : '0') . '); - FormEngineValidation.registerReady(); + FormEngine.Validation.setUsMode(' . ($GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? '1' : '0') . '); + FormEngine.Validation.registerReady(); }'; $this->requireJsModules['TYPO3/CMS/Backend/FormEngineReview'] = null; diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js index a4c9c3551bfc389903c5711b5a782ed0bfdf2f67..a31066fac18a2f6437c2d44ffdfc3ee7cd72470a 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js @@ -21,30 +21,32 @@ */ // add legacy functions to be accessible in the global scope -var setFormValueOpenBrowser - ,setFormValueFromBrowseWin - ,setHiddenFromList - ,setFormValueManipulate - ,setFormValue_getFObj; +var setFormValueOpenBrowser, + setFormValueFromBrowseWin, + setHiddenFromList, + setFormValueManipulate, + setFormValue_getFObj; /** * Module: TYPO3/CMS/Backend/FormEngine */ define(['jquery', + 'TYPO3/CMS/Backend/FormEngineValidation', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity' - ], function ($, Modal, Severity) { + ], function ($, FormEngineValidation, Modal, Severity) { /** * - * @type {{formName: *, openedPopupWindow: null, legacyFieldChangedCb: Function, browserUrl: string}} + * @type {{formName: *, openedPopupWindow: window, legacyFieldChangedCb: Function, browserUrl: string}} * @exports TYPO3/CMS/Backend/FormEngine */ var FormEngine = { - formName: TYPO3.settings.FormEngine.formName - ,openedPopupWindow: null - ,legacyFieldChangedCb: function() { !$.isFunction(TYPO3.settings.FormEngine.legacyFieldChangedCb) || TYPO3.settings.FormEngine.legacyFieldChangedCb(); } - ,browserUrl: '' + Validation: FormEngineValidation, + formName: TYPO3.settings.FormEngine.formName, + openedPopupWindow: null, + legacyFieldChangedCb: function() { !$.isFunction(TYPO3.settings.FormEngine.legacyFieldChangedCb) || TYPO3.settings.FormEngine.legacyFieldChangedCb(); }, + browserUrl: '' }; /** @@ -90,10 +92,12 @@ define(['jquery', exclusiveValues = String(exclusiveValues); var $fieldEl, - $originalFieldEl = $fieldEl = FormEngine.getFieldElement(fieldName), + $originalFieldEl, isMultiple = false, isList = false; + $originalFieldEl = $fieldEl = FormEngine.getFieldElement(fieldName); + if ($originalFieldEl.length === 0 || value === '--div--') { return; } diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js index ac9f619beb1caedae103fb46343c6cb24ef58ee6..b2c16fa374b9a2666c46193fc47ac88cc1101b4f 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js @@ -16,7 +16,7 @@ * Contains all JS functions related to TYPO3 TCEforms/FormEngineValidation * @internal */ -define(['jquery', 'TYPO3/CMS/Backend/FormEngine', 'moment'], function ($, FormEngine, moment) { +define(['jquery', 'moment'], function ($, moment) { /** * The main FormEngineValidation object @@ -1040,7 +1040,5 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine', 'moment'], function ($, FormEn FormEngineValidation.initialize(); }; - FormEngine.Validation = FormEngineValidation; - - return FormEngine.Validation; + return FormEngineValidation; });