[BUGFIX] Ignore hidden fields when un-/hiding fields 31/46231/2
authorChristian Futterlieb <christian@futterlieb.ch>
Mon, 25 Jan 2016 17:06:07 +0000 (18:06 +0100)
committerAlex Kellner <alexander.kellner@einpraegsam.net>
Mon, 25 Jan 2016 17:42:35 +0000 (18:42 +0100)
This applies only, when a checkbox field has to be hidden, because
the first field matching the rule in getFieldByMarker() will be the
hidden field (which is always generated by <f:form.checkbox/>).

Because fields with type="hidden" can never be unhidden, it is safe to
completely ignore them.

Change-Id: I09d428b0bf73b6067d939420718c646c67346c22
Resolves: #72486
Reviewed-on: https://review.typo3.org/46231
Reviewed-by: Alex Kellner <alexander.kellner@einpraegsam.net>
Tested-by: Alex Kellner <alexander.kellner@einpraegsam.net>
Resources/Public/JavaScript/PowermailCondition.js

index 48c9733..ed24aac 100644 (file)
@@ -213,7 +213,7 @@ function PowermailCondition($, $formElement) {
         * @returns {jQuery}
         */
        this.getFieldByMarker = function(fieldMarker, $form) {
-               return $form.find('[name^="tx_powermail_pi1[field][' + fieldMarker + ']"]');
+               return $form.find('[name^="tx_powermail_pi1[field][' + fieldMarker + ']"]').not('[type="hidden"]');
        };
 
        /**