Bug 34509

Summary: Cannot create baskets if too many vendors
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: AcquisitionsAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, jonathan.druart, lucas, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/750
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.04,22.11.10
Circulation function:
Attachments: Bug 34509: Use select2 to load vendors on basket creation
Bug 34509: Make select2 dropdown populate on change
Bug 34509: Use select2 to load vendors on basket creation
Bug 34509: Use select2 to load vendors on basket creation
Bug 34509: Use select2 to load vendors on basket creation
Bug 34509: Use select2 to load vendors on basket creation

Description Nick Clemens (kidclamp) 2023-08-09 17:39:36 UTC
When creating a new basket, we load every existing vendor into a dropdown and allow the user to choose which library the basket is for.

On systems with too many vendors, this can be problematic.

We should either remove this, as you generally create a basket from preselected vendor, or use the api to load vendor options as needed
Comment 1 Nick Clemens (kidclamp) 2023-08-09 17:50:20 UTC Comment hidden (obsolete)
Comment 2 Nick Clemens (kidclamp) 2023-08-09 17:51:15 UTC
Something is wrong in my patch though, it won't save the selection, help?
Comment 3 Lucas Gass (lukeg) 2023-08-09 20:49:30 UTC Comment hidden (obsolete)
Comment 4 Nick Clemens (kidclamp) 2023-08-24 12:32:57 UTC Comment hidden (obsolete)
Comment 5 Nick Clemens (kidclamp) 2023-08-24 13:03:13 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2023-08-24 13:05:31 UTC
Created attachment 154735 [details] [review]
Bug 34509: Use select2 to load vendors on basket creation

This patch moves the dropdown to use select2 and avoids loading all
vendors at page load.

To test:
 1 - Create some extra vendors in your system, ideally over 20
 2 - Search for a vendor in acquisitions
 3 - Click 'New->basket'
 4 - Note the dropdown of all vendors
 5 - Choose a vendor and create a basket
 6 - Apply patch
 7 - Repeat
 8 - Note only a partial list of vendors is loaded
 9 - Search in the dropdown and confirm vendors are returned
10 - Select a vendor and create the basket

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 Martin Renvoize (ashimema) 2023-08-24 15:51:20 UTC
Created attachment 154741 [details] [review]
Bug 34509: Use select2 to load vendors on basket creation

This patch moves the dropdown to use select2 and avoids loading all
vendors at page load.

To test:
 1 - Create some extra vendors in your system, ideally over 20
 2 - Search for a vendor in acquisitions
 3 - Click 'New->basket'
 4 - Note the dropdown of all vendors
 5 - Choose a vendor and create a basket
 6 - Apply patch
 7 - Repeat
 8 - Note only a partial list of vendors is loaded
 9 - Search in the dropdown and confirm vendors are returned
10 - Select a vendor and create the basket

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize (ashimema) 2023-08-24 15:52:05 UTC
Nice improvement, all working as expected.

Passing QA
Comment 9 Tomás Cohen Arazi (tcohen) 2023-08-29 17:36:32 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 10 Fridolin Somers 2023-08-29 21:44:15 UTC
Pushed to 23.05.x for 23.05.04
Comment 11 Matt Blenkinsop 2023-08-31 10:12:13 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x
Comment 12 Caroline Cyr La Rose 2023-11-10 14:59:19 UTC
I updated the screenshot in the manual.