Updating a line of an intervention with an invalid value (typical case: a mandatory extrafield left empty) made the page bail out with "dol_print_error + exit", which renders the generic Dolibarr error screen and loses the user's edit context. Replace the bail out with a setEventMessages on the same page, matching the pattern already used everywhere else in fichinter/card.php (object->error, object->errors, 'errors'). The caller stays on the intervention card, sees the validation message and can correct the field without losing what was being typed. Reported by @Timoune974 with the patch sketch already in the issue. Signed-off-by: Dolicraft <contact@dolicraft.com> Co-authored-by: Dolicraft <contact@dolicraft.com>
This commit is contained in:
parent
59dfe19a46
commit
c13648e96d
1 changed files with 4 additions and 2 deletions
|
|
@ -697,8 +697,10 @@ if (empty($reshook)) {
|
|||
|
||||
$result = $objectline->update($user);
|
||||
if ($result < 0) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
// Surface validation errors (e.g. mandatory extrafield left empty) as an
|
||||
// event message on the same page instead of breaking with a full Dolibarr
|
||||
// error screen that loses the user's edit context.
|
||||
setEventMessages($objectline->error, $objectline->errors, 'errors');
|
||||
}
|
||||
|
||||
// Define output language
|
||||
|
|
|
|||
Loading…
Reference in a new issue