FIX 11.0: when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized

Because of this, missing mandatory extrafields are not checked and no extrafields are inserted
This commit is contained in:
Florian Mortgat 2021-01-26 12:42:04 +01:00
parent a0fe2a8abc
commit 35448e3307

View File

@ -258,7 +258,13 @@ if (empty($reshook))
}
// Extrafields
$extrafields = new ExtraFields($db);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) {
$error++;
$action = 'create';
}
$array_options = $extrafields->getOptionalsFromPost($object->table_element);
$object->array_options = $array_options;