Commit 3bb7516a authored by Carsten  Rose's avatar Carsten Rose
Browse files

FillStoreForm.php: fixed problem with checkBoxes in templateGroups. During...

FillStoreForm.php: fixed problem with checkBoxes in templateGroups. During fillStoreForm the template group has been expanded to all possible elements - the logic for checkboxes expected that at least the '_h_<fe name>' Post Variable exist - which is not true for unexpanded elements.
parent 03b7e8e0
......@@ -192,7 +192,10 @@ class FillStoreForm {
// Checkbox Multi: collect values
if ($formElement[FE_TYPE] === 'checkbox') {
$clientValues[$clientFieldName] = $this->collectMultiValues($clientFieldName, $clientValues);
$val = $this->collectMultiValues($clientFieldName, $clientValues);
if($val !== false) {
$clientValues[$clientFieldName] = $val;
}
}
if ($formElement[FE_MODE] === FE_MODE_REQUIRED) {
......@@ -230,7 +233,7 @@ class FillStoreForm {
/**
* Steps through all $clientValues (POST vars) and collect all with the name _?_${clientFieldName} in a comma seperated string (MYSQL ENUM type).
* If there is no element '_h_${clientFieldName}', than there no multi values - return the already given `$clientValues[$clientFieldName]`.
* If there is no element '_h_${clientFieldName}', than there are no multi values - return the already given `$clientValues[$clientFieldName]`.
*
* @param $clientFieldName
* @param array $clientValues
......@@ -240,7 +243,13 @@ class FillStoreForm {
$checkboxKey = HelperFormElement::prependFormElementIdCheckBoxMulti($clientFieldName, 'h');
// Check there is a hidden value with naming in checkbox multi syntax
// For templateGroups: all expanded FormElements will be tried to collect - this fails for not submitted fields.
// Therefore skip not existing clientvalues.
if(!isset($clientValues[$checkboxKey])) {
return false;
}
// Check if there is a hidden value with naming in checkbox multi syntax
if (isset($clientValues[$checkboxKey])) {
$checkboxValue = $clientValues[$checkboxKey];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment