[BUGFIX] Display validation errors again in FormEngine 17/48417/3
authorMarkus Klein <markus.klein@typo3.org>
Tue, 31 May 2016 10:47:04 +0000 (12:47 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Tue, 31 May 2016 11:13:37 +0000 (13:13 +0200)
Resolves: #76392
Releases: 7.6
Change-Id: Ib74400e1bf988ff0802c3c2e5cd5965a69b6eb9a
Reviewed-on: https://review.typo3.org/48417
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js

index a53b4cc..66b012c 100644 (file)
@@ -274,7 +274,6 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
                                                                maxItems = rule.maxItems * 1;
                                                                if (!isNaN(maxItems) && selected > maxItems) {
                                                                        markParent = true;
-                                                                       $field.closest(FormEngineValidation.markerSelector).addClass(FormEngineValidation.errorClass);
                                                                }
                                                        }
                                                }
@@ -288,7 +287,6 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
                                                        var maxValue = rule.config.upper * 1;
                                                        if (!isNaN(maxValue) && value > maxValue) {
                                                                markParent = true;
-                                                               $field.closest(FormEngineValidation.markerSelector).addClass(FormEngineValidation.errorClass);
                                                        }
                                                }
                                        }
@@ -311,7 +309,6 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
                                                        maxItems = rule.maxItems * 1;
                                                        if (!isNaN(maxItems) && selected > maxItems) {
                                                                markParent = true;
-                                                               $field.closest(FormEngineValidation.markerSelector).addClass(FormEngineValidation.errorClass);
                                                        }
                                                }
                                        }
@@ -357,6 +354,9 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
                        }
                });
                if (markParent) {
+                       // mark field
+                       $field.closest(FormEngineValidation.markerSelector).addClass(FormEngineValidation.errorClass);
+
                        // check tabs
                        FormEngineValidation.markParentTab($field);
                }