Contract line : update boolean
This commit is contained in:
parent
34c61edcbd
commit
03765528e1
@ -5971,6 +5971,12 @@ abstract class CommonObject
|
||||
dol_syslog('Error bad setup of extrafield', LOG_WARNING);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'boolean':
|
||||
if (empty($this->array_options["options_".$key])) {
|
||||
$this->array_options["options_".$key] = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2216,15 +2216,22 @@ class ExtraFields
|
||||
$value_arr = (array) $value_arr;
|
||||
$value_key = implode(',', $value_arr);
|
||||
} elseif (in_array($key_type, array('price', 'double', 'int'))) {
|
||||
if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) {
|
||||
if (!GETPOSTISSET($keysuffix . "options_" . $key . $keyprefix)) {
|
||||
continue; // Value was not provided, we should not set it.
|
||||
}
|
||||
$value_arr = GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||
if ($keysuffix != 'search_') { // If value is for a search, we must keep complex string like '>100 <=150'
|
||||
$value_arr = GETPOST($keysuffix . "options_" . $key . $keyprefix);
|
||||
if ($keysuffix != 'search_') { // If value is for a search, we must keep complex string like '>100 <=150'
|
||||
$value_key = price2num($value_arr);
|
||||
} else {
|
||||
$value_key = $value_arr;
|
||||
}
|
||||
} elseif (in_array($key_type, array('boolean'))) {
|
||||
if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) {
|
||||
$value_key = '';
|
||||
} else {
|
||||
$value_arr = GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||
$value_key = $value_arr;
|
||||
}
|
||||
} else {
|
||||
if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) {
|
||||
continue; // Value was not provided, we should not set it.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user