Bug 14508 - 'New patron' dropdown empty list on circulation.pl
Summary: 'New patron' dropdown empty list on circulation.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 7380
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-08 20:10 UTC by Tomás Cohen Arazi
Modified: 2016-12-05 21:23 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
(wrong) Dropdown empty (112.50 KB, image/png)
2015-07-08 20:12 UTC, Tomás Cohen Arazi
Details
(correct) Dropdown with categories (121.50 KB, image/png)
2015-07-08 20:13 UTC, Tomás Cohen Arazi
Details
Bug 14508: 'New patron' dropdown empty list on circulation.pl (2.00 KB, patch)
2015-07-08 21:36 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
[Signed-off] Bug 14508: 'New patron' dropdown empty list on circulation.pl (2.19 KB, patch)
2015-07-09 14:32 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14508: 'New patron' dropdown empty list on circulation.pl (2.25 KB, patch)
2015-07-09 15:17 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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