Sorting by publication date sorts the list by field biblio.copyrightdate which is not bound with an UNIMARC field. I am not sure about the fix. Should we check the marc flavour to determine if we sort by biblio.copyrightdate and biblioitems.publicationyear ?
Created attachment 168437 [details] [review] Bug 37218: Sorting by publication date works unexpectedly in UNIMARC Steps to reproduce: 1 - Open a Koha with syspref "UNIMARC" set 2 - Search for items 3 - Sort by publication date -> there should be no change whatever you do In my previous comment, I had not noticed that this is clearly a bug: the results from search are put in the field "copyrightdate" whatever the MARC flavour so the line checking for marcflavour to pick the sort field is obsolete TEST PLAN: 1 - Open a Koha with syspref "UNIMARC" set 2 - Search for items 3 - Sort by publication date -> there should be no change whatever you do 4 - Apply patch and repeat 2&3 -> items should be changed
(In reply to Baptiste Wojtkowski (bwoj) from comment #1) Hi Baptiste, Here's what tested. > 3 - Sort by publication date -> there should be no change whatever you > do I searched "science" and sorted by "Publication/Copyright date: newest to oldest". The records are somewhat sorted but are still not in the expected order. > In my previous comment, I had not noticed that this is clearly a bug: > the results from search are put in the field "copyrightdate" whatever > the MARC flavour so the line checking for marcflavour to pick the sort > field is obsolete > > TEST PLAN: > 1 - Open a Koha with syspref "UNIMARC" set > 2 - Search for items > 3 - Sort by publication date -> there should be no change whatever you > do > 4 - Apply patch and repeat 2&3 -> items should be changed After applying the patch, same behaviour occured.
Bug was incorrectly reported and fix is breaking a working functionnality