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. Proposal: $row->authid should be placed outside of the quotes.
Created attachment 164718 [details] [review] 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.
Created attachment 164826 [details] [review] 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>
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.06
Backported to 23.05.x for upcoming 23.05.12