Skip to content

Commit

Permalink
Fix #3666 checkbox extrafields on edit
Browse files Browse the repository at this point in the history
  • Loading branch information
rdoursenaud committed Oct 5, 2015
1 parent 41354ca commit 3fdd59b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion htdocs/core/class/commonobject.class.php
Expand Up @@ -3601,7 +3601,16 @@ function showOptionals($extrafields, $mode='view', $params=0, $keyprefix='')
$value=$this->array_options["options_".$key];
break;
case "edit":
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$this->array_options["options_".$key]);
if (isset($_POST["options_" . $key])) {
if (is_array($_POST["options_" . $key])) {
// $_POST["options"] is an array but following code expects a comma separated string
$value = implode(",", $_POST["options_" . $key]);
} else {
$value = $_POST["options_" . $key];
}
} else {
$value = $this->array_options["options_" . $key];
}
break;
}
if ($extrafields->attribute_type[$key] == 'separate')
Expand Down

0 comments on commit 3fdd59b

Please sign in to comment.