Merge pull request #22615 from marc-dll/14.0_FIX_hidden_extrafields_update
FIX: only modify hidden checkbox/multislected extrafields on update if they are provided in request
This commit is contained in:
commit
bf794cacc0
@ -2084,13 +2084,21 @@ class ExtraFields
|
|||||||
|
|
||||||
$enabled = 1;
|
$enabled = 1;
|
||||||
if (isset($this->attributes[$object->table_element]['list'][$key])) {
|
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;
|
$perms = 1;
|
||||||
if (isset($this->attributes[$object->table_element]['perms'][$key])) {
|
if (isset($this->attributes[$object->table_element]['perms'][$key])) {
|
||||||
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1);
|
$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;
|
continue;
|
||||||
}
|
}
|
||||||
if (empty($perms)) {
|
if (empty($perms)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user