mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 00:53:48 +00:00
fix error with empty values with multiple and non-existant data
if a value was array(null) or array(_other => null, _choices => null), the isEmptyValue function failed.
This commit is contained in:
@@ -247,7 +247,7 @@ class CustomFieldChoice extends AbstractCustomField
|
||||
return $value;
|
||||
} else {
|
||||
// we have a field with "allow other"
|
||||
if (isset($value['_choices'])) {
|
||||
if (array_key_exists('_choices', $value)) {
|
||||
return $value['_choices'];
|
||||
} else {
|
||||
// we have a field with "multiple"
|
||||
@@ -273,13 +273,17 @@ class CustomFieldChoice extends AbstractCustomField
|
||||
if (is_array($value))
|
||||
{
|
||||
// if allow other
|
||||
if (isset($value['_choices'])) {
|
||||
if (array_key_exists('_choices', $value)) {
|
||||
if ($value['_choices'] === NULL) {
|
||||
return true;
|
||||
}
|
||||
return empty($value['_choices']);
|
||||
} else { // we do not have 'allow other'
|
||||
return empty($value);
|
||||
if (count($value) === 1){
|
||||
return empty($value[0]);
|
||||
} else {
|
||||
return empty($value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return empty($value);
|
||||
|
Reference in New Issue
Block a user