Commit 1761cc07 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Form update.

AbstractBuildForm.php: fixed broken JSON Object array
parent 6caf35c8
......@@ -393,7 +393,12 @@ abstract class AbstractBuildForm {
} else {
// for non container elements: just add the current json status
if ($modeCollectFe === FLAG_ALL || ($modeCollectFe == FLAG_DYNAMIC_UPDATE && $fe['dynamicUpdate'] == 'yes')) {
$json[] = $jsonElement;
if (isset($jsonElement[0]) && is_array($jsonElement[0])) {
// Checkboxes are delivered as array of arrays: unnest them and append them to the existing json array.
$json = array_merge($json, $jsonElement);
} else {
$json[] = $jsonElement;
}
}
}
......@@ -1070,6 +1075,7 @@ abstract class AbstractBuildForm {
* @return string
*/
public function buildCheckboxMulti(array $formElement, $htmlFormElementId, $attributeBase, $value, array $itemKey, array $itemValue, array &$json) {
$json = array();
// Defines which of the checkboxes will be checked.
$values = explode(',', $value);
......@@ -1115,7 +1121,6 @@ abstract class AbstractBuildForm {
$htmlElement = Support::wrapTag('<label>', $htmlElement);
}
$htmlElement = Support::wrapTag("<div class='$checkboxClass'>", $htmlElement, true);
if ($formElement['maxLength'] > 1) {
......@@ -1129,7 +1134,7 @@ abstract class AbstractBuildForm {
}
$html .= $htmlElement . $br;
$json[] = $this->getJsonElementUpdate($htmlFormElementId, $value, $formElement[FE_MODE]);
$json[] = $this->getJsonElementUpdate($htmlFormElementId, $jsonValue, $formElement[FE_MODE]);
}
......
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