Skip to content
Snippets Groups Projects
Commit 19f771e1 authored by Jared Hancock's avatar Jared Hancock
Browse files

forms: Restore saving of ID value for selection fields

parent c8301bc2
No related branches found
No related tags found
No related merge requests found
......@@ -983,10 +983,15 @@ class SelectionField extends FormField {
}
function to_database($value) {
$id = null;
if (is_array($value)) {
reset($value);
$id = key($value);
}
if ($value && is_array($value))
$value = JsonDataEncoder::encode($value);
return $value;
return array($value, $id);
}
function to_php($value, $id=false) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment