Adding some checking in facet branches
When using search via commandline scripts, branch facets are sometimes failing badly. Not a HASH reference at C4/Search.pm line 557, This patch prevents this Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
parent
e5c0c4a8a2
commit
6a73a3ddf5
1 changed files with 11 additions and 2 deletions
13
C4/Search.pm
13
C4/Search.pm
|
@ -513,8 +513,17 @@ sub getRecords {
|
|||
|
||||
# if it's a branch, label by the name, not the code,
|
||||
if ( $link_value =~ /branch/ ) {
|
||||
$facet_label_value =
|
||||
$branches->{$one_facet}->{'branchname'};
|
||||
if (defined $branches
|
||||
&& ref($branches) eq "HASH"
|
||||
&& defined $branches->{$one_facet}
|
||||
&& ref ($branches->{$one_facet}) eq "HASH")
|
||||
{
|
||||
$facet_label_value =
|
||||
$branches->{$one_facet}->{'branchname'};
|
||||
}
|
||||
else {
|
||||
$facet_label_value = "*";
|
||||
}
|
||||
}
|
||||
|
||||
# but we're down with the whole label being in the link's title.
|
||||
|
|
Loading…
Reference in a new issue