[Bug 13150] New: C4::Search::searchResults triggers software error by passing incorrect values to GetAuthorisedValueDesc
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13150 Bug ID: 13150 Summary: C4::Search::searchResults triggers software error by passing incorrect values to GetAuthorisedValueDesc Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Searching Assignee: gmcharlt@gmail.com Reporter: barton@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org The following error: Software error: Can't use string ("") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Biblio.pm line 1635. For help, please send mail to the webmaster (staff@bywatersolutions.com), giving this error message and the time and date of the error. Is triggered by a catalog search. In 3.16.03, line 1635 is the 'return' line: sub GetAuthorisedValueDesc { my ( $tag, $subfield, $value, $framework, $tagslib, $category, $opac ) = @_; my $dbh = C4::Context->dbh; if ( !$category ) { return $value unless defined $tagslib->{$tag}->{$subfield}->{'authorised_value'}; ... $tagslib is passed in as an empty string, which is being dereferenced as a hashref. The problem is this call in C4/Search.pm: $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; The fifth argument here is '', which should be a hashref. I have verified that this code exists in 3.14.03 as well as master. I have not yet determined how this logic is being called. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13150 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |kyle@bywatersolutions.com Resolution|--- |INVALID -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13150 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- This was caused by memcached needing a restart on this particular server. However, this could be solved in the code with a bit more testing: diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 61e4c3b..17afeaf 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1616,7 +1616,7 @@ sub GetAuthorisedValueDesc { if ( !$category ) { - return $value unless defined $tagslib->{$tag}->{$subfield}->{'authorised_value'}; + return $value unless $tagslib && defined $tagslib->{$tag}->{$subfield}->{'authorised_value'}; #---- branch if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) { -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org