Bug 14508

Summary: 'New patron' dropdown empty list on circulation.pl
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: TemplatesAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: chris, jonathan.druart, veron
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 7380    
Bug Blocks:    
Attachments: (wrong) Dropdown empty
(correct) Dropdown with categories
Bug 14508: 'New patron' dropdown empty list on circulation.pl
[Signed-off] Bug 14508: 'New patron' dropdown empty list on circulation.pl
Bug 14508: 'New patron' dropdown empty list on circulation.pl

Description Tomás Cohen Arazi 2015-07-08 20:10:48 UTC

    
Comment 1 Tomás Cohen Arazi 2015-07-08 20:12:59 UTC
Created attachment 40847 [details]
(wrong) Dropdown empty
Comment 2 Tomás Cohen Arazi 2015-07-08 20:13:26 UTC
Created attachment 40848 [details]
(correct) Dropdown with categories
Comment 3 Tomás Cohen Arazi 2015-07-08 20:16:08 UTC
Steps to reproduce:
- On master (and 3.20 at least)
- On the checkout form, perform a 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)
Comment 4 Tomás Cohen Arazi 2015-07-08 21:36:40 UTC Comment hidden (obsolete)
Comment 5 Marc Véron 2015-07-09 14:32:18 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-07-09 15:17:59 UTC
Created attachment 40891 [details] [review]
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>
Comment 7 Tomás Cohen Arazi 2015-07-10 14:03:25 UTC
Patch pushed to master.

Thanks for QAing this fast!
Comment 8 Chris Cormack 2015-07-14 20:48:34 UTC
Pushed to 3.20.x will be in 3.20.2