From e2f4821e5cbcfd23b2e3f4597ef25cb2ae5d7159 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 8 Jul 2015 18:25:45 -0300 Subject: [PATCH] [Signed-off] Bug 14508: 'New patron' dropdown empty list on circulation.pl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch makes includes/patron-toolbar.inc (the one in charge of rendering the 'New patron' dropdown) make use of the Categories Template Toolkit plugin to create the list of categories. (1) To check the setup is sane: - Go to the Patrons page => SUCCESS: The 'New patron' dropdown is populated - Click on the [+] symbol on the Patron search on the top => SUCCESS: The Categories dropdown is populated (2) To test the patch: - On the checkout form, perform a patron search that (a) returns more than one result (b) returns zero results - Click the dropdown menu to create a new patron => FAIL: Dropdown is empty - Repeat for (a) or (b) - Apply the patch and reload => SUCCESS: The dropdown is correctly populated - Repeat (1) => SUCCESS: Nothing got broken - Verify the logs => SUCCESS: No new warnings - Sign off :-D - Get a cookie - Smile Regards Discussion: we might need a new bug to start cleaning stuff like this: @categories=C4::Category->all; if(scalar(@categories) < 1){ $no_add = 1; $template->param(no_categories => 1); } else { $template->param(categories=>\@categories); } but it belongs to a new bug me thinks. Well, suggestions are welcome, but this must be fixed on stable ASAP so hurry :-D Followed test plan, works as expected. Signed-off-by: Marc VĂ©ron --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc index 10c14a8..2df6cec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc @@ -1,3 +1,6 @@ +[% USE Categories %] +[% SET categories = Categories.all %] + [% UNLESS ( no_add ) %]
-- 1.7.10.4