Merge pull request #21477 from atm-gauthier/14.0_fix_extrafields_chkbxlst_cannot_be_emptied

FIX : backport commit 5b3fcc5e43, chkbx…
This commit is contained in:
Laurent Destailleur 2022-07-10 18:46:04 +02:00 committed by GitHub
commit e78cc17848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2072,7 +2072,7 @@ class ExtraFields
if (!empty($onlykey) && $onlykey != '@GETPOSTISSET' && $key != $onlykey) {
continue;
}
if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && $this->attributes[$object->table_element]['type'][$key] != 'boolean') {
if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'chkbxlst')))) {
//when unticking boolean field, it's not set in POST
continue;
}