FIX: only modify hidden checkbox/multislected extrafields on update if they are provided in request
This commit is contained in:
parent
459086b11e
commit
82ca472245
@ -2084,13 +2084,21 @@ class ExtraFields
|
||||
|
||||
$enabled = 1;
|
||||
if (isset($this->attributes[$object->table_element]['list'][$key])) {
|
||||
$enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1);
|
||||
$enabled = intval(dol_eval($this->attributes[$object->table_element]['list'][$key], 1));
|
||||
}
|
||||
$perms = 1;
|
||||
if (isset($this->attributes[$object->table_element]['perms'][$key])) {
|
||||
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1);
|
||||
}
|
||||
if (empty($enabled)) {
|
||||
if (
|
||||
empty($enabled)
|
||||
|| (
|
||||
$onlykey === '@GETPOSTISSET'
|
||||
&& in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'chkbxlst'))
|
||||
&& in_array(abs($enabled), array(2, 5))
|
||||
&& ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided
|
||||
)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (empty($perms)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user