Fix: Ajax on/off not saving value in DB after updating to version >=12

The issue seams to be that starting in version 12 the "[element]_UPDATE" trigger is called in file core/ajax/objectonoff.php but some properties that are required on $object are not set.
This commit is contained in:
dvdwalker 2021-02-24 19:28:47 -03:00 committed by GitHub
parent f7c119e48c
commit 4c321341d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,10 @@ if (($action == 'set') && !empty($id)) {
if ($tablename == 'websitepage') $tablename = 'website_page';
$format = 'int';
$object->table_element = $tablename;
$object->id = $id;
$object->fields[$field] = array('type' => $format, 'enabled' => 1);
$object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey);
}