From db37744333098227507c4bfb95eb0e6d7cfc9cd2 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 1 Jan 2008 15:56:22 -0600 Subject: [PATCH] Bugfix for 1725 request.pl erroring with a biblio that has no items Signed-off-by: Joshua Ferraro --- .../intranet-tmpl/prog/en/modules/reserve/request.tmpl | 8 ++++++-- reserve/request.pl | 10 +++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl index bc64e2f0bb..cfbf61db8b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl @@ -86,7 +86,11 @@ if (alreadyreserved > "0"){
- + +

+Sorry, this biblio has no items attached +

+

Hold found for (), please transfer

@@ -371,7 +375,7 @@ if (alreadyreserved > "0"){ - +
diff --git a/reserve/request.pl b/reserve/request.pl index ac95675b14..a49b56e96b 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -214,7 +214,15 @@ my $fixedRank = $count+1; my @branchcodes; my %itemnumbers_of_biblioitem; -my @itemnumbers = @{ get_itemnumbers_of($biblionumber)->{$biblionumber} }; +my @itemnumbers; + +if (my $items = get_itemnumbers_of($biblionumber)->{$biblionumber}){ + @itemnumbers = @$items; +} +else { + $template->param('noitems' => 1); +} + my $iteminfos_of = GetItemInfosOf(@itemnumbers); foreach my $itemnumber (@itemnumbers) { -- 2.39.5