[BUGFIX] FormEngine: Initialize validation of new flexform sections 65/44565/3
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 6 Nov 2015 08:20:19 +0000 (09:20 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 6 Nov 2015 14:41:07 +0000 (15:41 +0100)
When adding a new section to a flexform the validation engine needs
to be made aware of the new input fields so that the entered data
gets validated and copied from the human readable field into to the
hidden field counterpart so that it's persisted on save.

Resolves: #71322
Releases: master
Change-Id: I84fc6f3d2e5c539a36ba4610083b4254db417308
Reviewed-on: https://review.typo3.org/44565
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/Container/FlexFormSectionContainer.php

index e2725fd..82c0956 100644 (file)
@@ -138,6 +138,8 @@ class FlexFormSectionContainer extends AbstractContainer
             }
             $onClickInsert[] = 'TBE_EDITOR.addActionChecks("submit", unescape("' . rawurlencode(implode(';', $flexFormContainerContainerTemplateResult['additionalJavaScriptSubmit'])) . '").' . $identifierPrefixJs . ');';
             $onClickInsert[] = 'TYPO3.FormEngine.reinitialize();';
+            $onClickInsert[] = 'TYPO3.FormEngine.Validation.initializeInputFields();';
+            $onClickInsert[] = 'TYPO3.FormEngine.Validation.validate();';
             $onClickInsert[] = 'return false;';
 
             $containerTemplateHtml[] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars(implode(LF, $onClickInsert)) . '">';