[BUGFIX] Flexform: Removing section element with empty required field 32/44732/2
authorFrank Nägler <frank.naegler@typo3.org>
Mon, 16 Nov 2015 10:44:28 +0000 (11:44 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 16 Nov 2015 15:20:27 +0000 (16:20 +0100)
Resolves: #71323
Releases: master
Change-Id: I7836db48d33887c15d1a41bacba0d9fb02fd3a78
Reviewed-on: https://review.typo3.org/44732
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineFlexForm.js
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js

index 47cf87f..1d97b3e 100644 (file)
@@ -94,6 +94,7 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($) {
                                        if (window.confirm('Are you sure?')) {
                                                $(this).closest(opts.sectionSelector).hide().addClass(opts.sectionDeletedClass);
                                                me.setActionStatus();
+                                               TYPO3.FormEngine.Validation.validate();
                                        }
                                });
 
index 9cc55e2..321e8cd 100644 (file)
@@ -472,10 +472,12 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
 
                $(FormEngineValidation.rulesSelector).each(function() {
                        var $field = $(this);
-                       var newValue = FormEngineValidation.validateField($field);
-                       if (newValue.length && $field.val() !== newValue) {
-                               $field.attr('value', newValue);
-                               FormEngineValidation.setCaretPosition($field, 0);
+                       if (!$field.closest('.t3js-flex-section-deleted').length) {
+                               var newValue = FormEngineValidation.validateField($field);
+                               if (newValue.length && $field.val() !== newValue) {
+                                       $field.attr('value', newValue);
+                                       FormEngineValidation.setCaretPosition($field, 0);
+                               }
                        }
                });
        };