From 0175434e51a78d3f9c3942b628be0e76a40c6c8e Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 8 May 2025 21:28:23 +0000 Subject: [PATCH] Bug 23010: Handle error in C4/Items.pm using try/catch --- C4/Items.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/C4/Items.pm b/C4/Items.pm index 7f9f3fccdc2..2c22518dc5b 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1732,7 +1732,17 @@ sub ToggleNewStatus { $item->$field($value); push @{ $report->{$itemnumber} }, $substitution; } - $item->store unless $report_only; + unless ($report_only) { + try { + $item->store; + } catch { + push @{ $report->{$itemnumber} }, { + field => 'ERROR', + error => 1, + value => $_->error, + } + } + } } } -- 2.39.5