checkbox not updated when unchecked

GETPOSTISSET return false in this case and the value is not updated
This commit is contained in:
BENKE Charlene 2020-02-28 15:29:12 +01:00 committed by GitHub
parent 9f5bde2131
commit 477cce718b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,6 +128,13 @@ if ($action == 'update' && !empty($permissiontoadd))
if ($object->fields[$key]['type'] == 'duration') {
if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) continue; // The field was not submited to be edited
}
elseif ($object->fields[$key]['type'] == 'boolean') {
if (!GETPOSTISSET($key)) {
$object->$key = null;
continue; // The field was not submited to be edited
}
}
else {
if (!GETPOSTISSET($key)) continue; // The field was not submited to be edited
}