Bug 21206 replaced GetItem for Koha::Items->find, and introduced this
problem. This patch verifies $item is defined before attempting to use
its methods.
To test:
- Log into SCO
- Type an invalid barcode
=> FAIL: Things explode :-/
- Apply this patch, reload
- Type an invalid barcode
=> SUCCESS: A nice error message is displayed :-D
- Sign off :-D
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
if (scalar keys %$impossible) {
my $issue_error = (keys %$impossible)[0]; # FIXME This is wrong, we assume only one error and keys are not ordered
+ my $title = ( $item ) ? $item->biblio->title : '';
$template->param(
impossible => $issue_error,
"circ_error_$issue_error" => 1,
- title => $item->biblio->title, # FIXME Need to be backport! GetItem did not return the biblio's title
+ title => $title,
hide_main => 1,
);
if ($issue_error eq 'DEBT') {