]> git.koha-community.org Git - koha.git/commit
Bug 33205: (bug 28268 follow-up) Method call $row->authid inside quotes - produces...
authorJanusz Kaczmarek <januszop@gmail.com>
Sat, 11 Mar 2023 10:45:32 +0000 (11:45 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 28 May 2024 19:29:09 +0000 (19:29 +0000)
commit2bb2dbf9590f3ddcf952f80edf9d25e49bd7d477
tree5db9e9e56384c9171d616ce5a4f617b841721b0e
parent3ea35a353ff039a8cd7e56bc8341e13dd5b03ce8
Bug 33205: (bug 28268 follow-up) Method call $row->authid inside quotes - produces meaningless warning

Bug 28268, in
Koha::MetadataRecord::Authority::get_all_authorities_iterator,
introduced a warning:

warn "Something went wrong reading record for authority $row->authid: $@\n";

But a method cannot be called from within quotes in Perl - extrapolation
does not work for functions/methods.  So, if something really goes
wrong, this line of code produces a warning like:

Something went wrong reading record for authority
Koha::Schema::Result::AuthHeader=HASH(0x55cf7e0d0958)->authid: Empty
String at /usr/share/perl5/MARC/File/XML.pm line 450.

which is not very informative -- authid is missing.

Test plan
=========
Hard to reproduce.  This problem occurs only in rare cases of some weird problem
in stores authority data or if a auth record had been deleted after a ES reindex
action has been initiated.  But the problem in the code and the fix seem obvious.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9c2510ea2ef1db46bf42cf948b6c599250d6dd9e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fb3473dfe3abe71b9545f19035d47e84f59c69d6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Koha/MetadataRecord/Authority.pm