[Koha-patches] [PATCH] Bug 11832 - JavaScript error on staff client place hold screen if record has no items

Owen Leonard oleonard at myacpl.org
Mon Feb 24 17:48:31 CET 2014


If a hold operation is blocked because the title has no items attached
the patron search autocomplete JavaScript triggers an error. This patch
modifies the template so that the JS is loaded only when items are
present.

To test, find a title which has no items attached. View the holds page
for that title. There should be no JavaScript error. Patron search
autocomplete should still work correctly for titles which have items
attached.
---
 .../prog/en/modules/reserve/request.tt             |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
index b084e25..1092166 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
@@ -131,7 +131,7 @@ function checkMultiHold() {
 
     $('#hold-request-form').preventDoubleFormSubmit();
 
-[% UNLESS ( borrowernumber || borrower_list ) %]
+[% UNLESS ( borrowernumber || borrower_list || noitems ) %]
     [% IF ( CircAutocompl ) %]
     $( "#patron" ).autocomplete({
         source: "/cgi-bin/koha/circ/ysearch.pl",
-- 
1.7.9.5


More information about the Koha-patches mailing list