[Koha-bugs] [Bug 17480] UpdateNotForLoanStatusOnCheckin preference requires space after colon
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Mar 22 10:50:27 CET 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17480
--- Comment #5 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
(In reply to Katrin Fischer from comment #3)
> Should we deactivate the feature somehow if misconfigured so it doesn't
> break things?
diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index e190019ae1a..b4437331027 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -2150,8 +2150,8 @@ sub AddReturn {
$yaml = "$yaml\n\n"; # YAML is anal on ending \n. Surplus does not
hurt
my $rules;
eval { $rules = YAML::XS::Load(Encode::encode_utf8($yaml)); };
- if ($@) {
- warn "Unable to parse UpdateNotForLoanStatusOnCheckin syspref :
$@";
+ if ($@ || ref($rules) ne 'HASH') {
+ warn "Unable to parse UpdateNotForLoanStatusOnCheckin syspref " .
($@ ? " : $@" || "");
}
else {
foreach my $key ( keys %$rules ) {
This patch does what you want, but I don't think it's a good idea. If something
is misconfigured it should not be ignored. Only the warn in the logs is
certainly very easy to missed.
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
More information about the Koha-bugs
mailing list