From: Matthias Schmidt Date: Sun, 28 Jul 2013 21:44:23 +0000 (+0200) Subject: Fixes issue with unchecked checkboxes during package installation X-Git-Tag: 2.0.0_Beta_6~28^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3bbe83f02333b94d9810a6418847349496d6bde9;p=GitHub%2FWoltLab%2FWCF.git Fixes issue with unchecked checkboxes during package installation If one checkbox is unchecked, no further input element is evaluated since `return false;` is executed which terminates the iteration instead of (as intended) continuing the iteration with the next input element. --- diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index 6b5f908226..c2c503ccb9 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -612,34 +612,32 @@ WCF.ACP.Package.Installation = Class.extend({ var $inputElement = $(inputElement); var $type = $inputElement.attr('type'); - if (($type == 'checkbox' || $type == 'radio') && !$inputElement.prop('checked')) { - return false; - } - - var $name = $inputElement.attr('name'); - if ($name.match(/(.*)\[([^[]*)\]$/)) { - $name = RegExp.$1; - $key = RegExp.$2; - - if ($additionalData[$name] === undefined) { + if (($type != 'checkbox' && $type != 'radio') || $inputElement.prop('checked')) { + var $name = $inputElement.attr('name'); + if ($name.match(/(.*)\[([^[]*)\]$/)) { + $name = RegExp.$1; + $key = RegExp.$2; + + if ($additionalData[$name] === undefined) { + if ($key) { + $additionalData[$name] = { }; + } + else { + $additionalData[$name] = [ ]; + } + } + if ($key) { - $additionalData[$name] = { }; + $additionalData[$name][$key] = $inputElement.val(); } else { - $additionalData[$name] = [ ]; + $additionalData[$name].push($inputElement.val()); } } - - if ($key) { - $additionalData[$name][$key] = $inputElement.val(); - } else { - $additionalData[$name].push($inputElement.val()); + $additionalData[$name] = $inputElement.val(); } } - else { - $additionalData[$name] = $inputElement.val(); - } }); this._executeStep(data.step, data.node, $additionalData);