Bug 14508: 'New patron' dropdown empty list on circulation.pl
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 8 Jul 2015 21:25:45 +0000 (18:25 -0300)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 14 Jul 2015 20:47:23 +0000 (08:47 +1200)
commitf40acf3c32e9cbe469b3699e6c92601477ec4565
tree42451a88bf6bf6b9f440bef6ca5b095a5a6ff052
parent757394fd0334c14cd295674b58c57cc7d8e9aebb
Bug 14508: 'New patron' dropdown empty list on circulation.pl

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 <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 5a57b3c163e6609aa99ab34e906aa05bd033d5ff)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc