Bug 24940

Summary: Serials statistics wizard: order vendor list alphabetically
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: ReportsAssignee: David Roberts <david.roberts>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: 1joynelson, david.roberts, jonathan.druart, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11
Circulation function:
Bug Depends on:    
Bug Blocks: 17258, 28216    
Attachments: Bug 24940: Serials statistics wizard: order vendor list alphabetically
Bug 24940: Serials statistics wizard: order vendor list alphabetically
Bug 24940: Serials statistics wizard: order vendor list alphabetically

Description Katrin Fischer 2020-03-22 22:33:51 UTC
Currently the vendor pull down in the serials statistics wizard appears to be ordered by vendor id instead of sorting alphabetically by vendor name. This is quite confusing for a longer list.

To test:
- Add at least 2 vendors: 
 - First: Zzzz
 - Second: Aaaa
- Add subscriptions for each of the vendors
- Check the pull down in the serials statistics wizard
- Verify it lists them as Zzzz, Aaaa
Comment 1 David Roberts 2020-04-03 15:28:02 UTC
Created attachment 102390 [details] [review]
Bug 24940: Serials statistics wizard: order vendor list alphabetically

This patch changes the dropdown from being sorted by aqbookseller.id to
aqbookseller.name

To test:
1) Add at least 2 vendors:
 - First: ZZZZ
 - Second: AAAA
2) Add subscriptions for each of the vendors
3) Check the pull down in the serials statistics wizard and verify it
lists them as ZZZZ, AAAA
4) Apply the patch
5) Re-check the pull down in the wizard and check that the vendors are
now listed AAAA,ZZZZ
Comment 2 Devinim 2020-04-04 20:13:25 UTC
Created attachment 102401 [details] [review]
Bug 24940: Serials statistics wizard: order vendor list alphabetically

This patch changes the dropdown from being sorted by aqbookseller.id to
aqbookseller.name

To test:
1) Add at least 2 vendors:
 - First: ZZZZ
 - Second: AAAA
2) Add subscriptions for each of the vendors
3) Check the pull down in the serials statistics wizard and verify it
lists them as ZZZZ, AAAA
4) Apply the patch
5) Re-check the pull down in the wizard and check that the vendors are
now listed AAAA,ZZZZ

It worked as described.

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Comment 3 David Roberts 2020-04-04 22:47:55 UTC
Thanks Devinim! :-)
Comment 4 Jonathan Druart 2020-04-08 08:11:32 UTC
And it even fixes a SQL error (with strict modes on)

DBD::mysql::st execute failed: 'koha_kohadev.aqbooksellers.name' isn't in GROUP BY [for Statement "SELECT aqbooksellerid, aqbooksellers.name
                                FROM subscription
                                  LEFT JOIN aqbooksellers ON (subscription.aqbooksellerid=aqbooksellers.id )
                                GROUP BY aqbooksellerid
Comment 5 Jonathan Druart 2020-04-08 08:11:59 UTC
Created attachment 102533 [details] [review]
Bug 24940: Serials statistics wizard: order vendor list alphabetically

This patch changes the dropdown from being sorted by aqbookseller.id to
aqbookseller.name

To test:
1) Add at least 2 vendors:
 - First: ZZZZ
 - Second: AAAA
2) Add subscriptions for each of the vendors
3) Check the pull down in the serials statistics wizard and verify it
lists them as ZZZZ, AAAA
4) Apply the patch
5) Re-check the pull down in the wizard and check that the vendors are
now listed AAAA,ZZZZ

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Martin Renvoize (ashimema) 2020-04-08 10:55:30 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 7 Joy Nelson 2020-05-01 18:59:04 UTC
backported to 19.11.x for 19.11.06
Comment 8 Lucas Gass (lukeg) 2020-05-11 21:45:42 UTC
backported to 19.05.x for 19.05.11