Bug 14047

Summary: Sort z39.50 biblio servers by rank in derivate cataloguing doesn't work
Product: Koha Reporter: Zeno Tajoli <ztajoli>
Component: CatalogingAssignee: Zeno Tajoli <ztajoli>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: chris, jonathan.druart, m.de.rooy, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Patch for sorting z39.50 servers
Patch for sorting z39.50 servers IN acq
Bug 14047: Order z39.50 biblioservers in cataloguing
Bug 14047: Sort z39.50 servers in Acquisition
Bug 14047: [QA Follow-up] Move result_class back into attributes
Bug 14047: Order z39.50 biblioservers in cataloguing

Description Zeno Tajoli 2015-04-22 14:42:53 UTC
When you insert/modify a z39.50 server to use it in derivate cataloguing you can insert 'rank': [it] lets you enter where in the list you'd like this target to appear. If this is left blank the targets will be in alphabetical order.

If you use authority servers it is OK.
If you use bibliographic servers it doesn't work

Now z39.50 bibliographic servers are sorted by id (insert order).

This is because now we use DBIx in cataloguing/z3950_search.pl without an 'order_by'.
The patch inserts 'order_by' instruction

To test it:
1)Insert 3-4 z39.50 biblio servers and insert different values into 'rank' fields.
2)See the if you change 'rank', the order doesn't change
3)Apply the patch
4)See that now order is based on 'rank' and 'servername'
Comment 1 Zeno Tajoli 2015-04-22 15:15:02 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2015-04-29 09:25:20 UTC
Zeno, same code is used in cataloguing/z3950_search.pl, you need to copy/paste your change.

(That's exactly why I did not want to see DBIx::Class queries in pl files...)
Comment 3 Jonathan Druart 2015-04-29 09:26:17 UTC
I meant acqui/z3950_search.pl
Comment 4 Zeno Tajoli 2015-05-15 14:57:30 UTC Comment hidden (obsolete)
Comment 5 Zeno Tajoli 2015-05-15 14:59:23 UTC
To fix the bug you must applay the two patch.

To test the second patch you need to use z39.50 inside an order into ACQ
Comment 6 Marcel de Rooy 2015-05-18 17:15:35 UTC Comment hidden (obsolete)
Comment 7 Marcel de Rooy 2015-05-18 17:15:39 UTC Comment hidden (obsolete)
Comment 8 Marcel de Rooy 2015-05-18 17:15:42 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2015-05-22 14:14:19 UTC
Created attachment 39412 [details] [review]
Bug 14047: Order z39.50 biblioservers in cataloguing

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 14047: Sort z39.50 servers in Acquisition

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 14047: [QA Follow-up] Move result_class back into attributes

No need to put this into a separate call.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Note that we strictly speaking do not need the hashref inflator here,
because TT understands hash.column as well as object.property.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Comment 10 Jonathan Druart 2015-05-22 14:15:22 UTC
To gain readability, I squashed the 3 patches.
Marcel I hope you don't mind and you are fine with that.
Comment 11 Tomás Cohen Arazi (tcohen) 2015-06-01 17:35:35 UTC
Patch pushed to master.

Thanks Zeno!
Comment 12 Chris Cormack 2015-06-03 20:52:21 UTC
Pushed to 3.20.x will be in 3.20.1