@@ -, +, @@ commit d564d3732d95455b4626dfa8ca711cd658003c17 Bug 15629: Koha::Libraries - Remove GetBranchInfo Can't call method "branchname" on an undefined value at /home/katrin/kohaclone/opac/opac-suggestions.pl line 153. -Staff -OPAC --- opac/opac-suggestions.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/opac/opac-suggestions.pl +++ a/opac/opac-suggestions.pl @@ -150,7 +150,12 @@ if ( $op eq "delete_confirm" ) { print $input->redirect("/cgi-bin/koha/opac-suggestions.pl?op=else"); exit; } -map{ $_->{'branchcodesuggestedby'} = Koha::Libraries->find($_->{'branchcodesuggestedby'})->branchname} @$suggestions_loop; + +map{ + my $s = $_; + my $library = Koha::Libraries->find($s->{branchcodesuggestedby}); + $library ? $s->{branchcodesuggestedby} = $library->branchname : () +} @$suggestions_loop; foreach my $suggestion(@$suggestions_loop) { if($suggestion->{'suggestedby'} == $borrowernumber) { --