Bug 35885 - ERM vendor sort order
Summary: ERM vendor sort order
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: ERM (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-23 20:33 UTC by Laura Escamilla
Modified: 2025-02-17 14:07 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 35885: Sort vendors by name by default (1.05 KB, patch)
2025-02-10 14:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35885: Sort vendors by name by default (1.55 KB, patch)
2025-02-12 09:02 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 35885: Sort vendors by name by default (1.65 KB, patch)
2025-02-14 08:55 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Laura Escamilla 2024-01-23 20:33:49 UTC
Currently the vendor drop-down list shows the vendors in the order that they were added to the Acquisitions module. It would be ideal if the vendors were sorted in alphabetical order so that libraries could easily locate their selection.
Comment 1 Jeremy Evans 2025-02-05 12:30:56 UTC
We have come across this issue recently. As we have many more vendors in the system now the vendor drop down is not very useful as the entries are not displaying in alphabetical order.  However if you start typing then the relevant entries will show up.
Comment 2 Jonathan Druart 2025-02-10 14:42:39 UTC Comment hidden (obsolete)
Comment 3 Magnus Enger 2025-02-12 07:59:57 UTC
Not sure if I am missing something here: 

- Set ERMModule = Enable
- In the Acquisitions module I added 4 vendors, with names X, A, C, Y, in that order
- Went to E-resource management > Agreements > New agreement
- In the "Vendor" dropdpwn, the vendors are listed in the order they were entered, X, A, C, Y
- Applied the patch + restart_all
- Reloaded the "New agreement" page, but the vendors are listed in the same order, the order they were entered
Comment 4 Jonathan Druart 2025-02-12 08:13:47 UTC
Force reload to clear the browser's cache.

You should see in the network tab:
GET http://localhost:8081/api/v1/acquisitions/vendors?_per_page=-1&_order_by=name
Comment 5 Magnus Enger 2025-02-12 08:41:48 UTC
I have shift-reloaded, restarted the browser and tested in an incognito window, but the call I see being made is: 

http://localhost:8081/api/v1/acquisitions/vendors?_per_page=-1

without the "_order_by=name".
Comment 6 Jonathan Druart 2025-02-12 08:48:34 UTC
Sorry I always have it running so I forgot. You need to rebuild the JS: `yarn js:build`

`yarn js:watch` will auto-rebuild when files are modified.
Comment 7 Magnus Enger 2025-02-12 09:02:39 UTC
Created attachment 177828 [details] [review]
Bug 35885: Sort vendors by name by default

Signed-off-by: Magnus Enger <magnus@libriotech.no>
To reproduce:
- Set ERMModule = Enable
- In the Acquisitions module I added 4 vendors, with names
  X, A, C, Y, in that order
- Went to E-resource management > Agreements > New agreement
- In the "Vendor" dropdown, the vendors are listed in the
  order they were entered: X, A, C, Y

To test:
- Applied the patch + restart_all + run "yarn js:build" in the
  cloned Koha repo inside KTD
- Shift-reload the "New agreement" page
- Vendors are in alphabetical order
Comment 8 Marcel de Rooy 2025-02-14 08:55:10 UTC
Created attachment 178087 [details] [review]
Bug 35885: Sort vendors by name by default

Signed-off-by: Magnus Enger <magnus@libriotech.no>
To reproduce:
- Set ERMModule = Enable
- In the Acquisitions module I added 4 vendors, with names
  X, A, C, Y, in that order
- Went to E-resource management > Agreements > New agreement
- In the "Vendor" dropdown, the vendors are listed in the
  order they were entered: X, A, C, Y

To test:
- Applied the patch + restart_all + run "yarn js:build" in the
  cloned Koha repo inside KTD
- Shift-reload the "New agreement" page
- Vendors are in alphabetical order

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Katrin Fischer 2025-02-17 13:24:02 UTC
Very happy about this one :)
Comment 10 Katrin Fischer 2025-02-17 14:07:03 UTC
Pushed for 25.05!

Well done everyone, thank you!