Log Noise - OpenILS/Application/Search/Biblio.pm - == 'ARRAY'

Bug #1848975 reported by Josh Stompro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

EG 3.3.4

I'm seeing the following in our logs.

2019-10-20 20:40:28 virt-egapp2 open-ils.search: [WARN:9253:Application.pm:624:157162144293423] open-ils.search.biblio.record.mods_slim.retrieve: Argument "ARRAY" isn't numeric in numeric eq (==) at /usr/local/share/perl/5.20.2/OpenILS/Application/Search/Biblio.pm line 142.

The code around 142 look like

   138 sub record_id_to_mods_slim {
   139 my( $self, $client, $id ) = @_;
   140 return undef unless defined $id;
   141
   142 if(ref($id) and ref($id) == 'ARRAY') {
   143 return _records_to_mods( @$id );
   144 }
   145 my $mods_list = _records_to_mods( $id );
   146 my $mods_obj = $mods_list->[0];
   147 return OpenILS::Event->new('BIBLIO_RECORD_ENTRY_NOT_FOUND') unless $mods_obj;
   148 return $mods_obj;
   149 }

Maybe that should be ref($id) eq 'ARRAY') since ref returns a string and 'ARRAY' is a string?

Josh

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Hello, here is a branch with this fix.
user/stompro/lp1848975_mods_slim_array_warning
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/stompro/lp1848975_mods_slim_array_warning

I found that the main use of open-ils.search.biblio.record.mods_slim.retrieve with an array of record ID's in our system is the Mobius Carousel add on - https://github.com/mcoia/mobius_evergreen/blob/master/bookbag_update/var/web/opac/skin/default/js/carousel/bbag_flesh.js

It doesn't look like there are many other normal calls to that service with an array of bib ids in the evergreen codebase. So this may not come up for many others.

Testing - It is easy to trigger this warning using the srfsh shell with a command like.

request open-ils.search open-ils.search.biblio.record.mods_slim.retrieve [102916]

Check the logs for the warning.

After applying the fix, the warning goes away.

Josh

tags: added: pullrequest
Changed in evergreen:
milestone: none → 3.6.1
tags: added: cleanup
Changed in evergreen:
milestone: 3.6.1 → 3.6.2
Changed in evergreen:
milestone: 3.6.2 → 3.6.3
Changed in evergreen:
milestone: 3.6.3 → 3.6.4
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks for looking at this, and for the branch, Josh! It looks like this was also caught in bug 1895660, which was recently merged, so I am marking this as a duplicate.

Changed in evergreen:
milestone: 3.6.4 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.