Merge pull request #27608 from Thomas905/fix/editextrafieldsdoncard

FIX : add action update_extras to don card
This commit is contained in:
Laurent Destailleur 2024-01-18 15:24:36 +01:00 committed by GitHub
commit 0412374568
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -308,6 +308,30 @@ if (empty($reshook)) {
$object->setProject($projectid);
}
if ($action == 'update_extras') {
$object->fetch($id);
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from update form
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
if ($ret < 0) {
$error++;
}
if (!$error) {
$result = $object->insertExtraFields('DON_MODIFY');
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
}
if ($error) {
$action = 'edit_extras';
}
}
// Actions to build doc
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';