Bug 37218 - Sorting by publication date works unexpectedly in UNIMARC
Summary: Sorting by publication date works unexpectedly in UNIMARC
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-28 10:34 UTC by Baptiste Wojtkowski (bwoj)
Modified: 2025-06-02 20:45 UTC (History)
2 users (show)

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


Attachments
Bug 37218: Sorting by publication date works unexpectedly in UNIMARC (1.37 KB, patch)
2024-07-03 10:54 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Baptiste Wojtkowski (bwoj) 2024-06-28 10:34:52 UTC
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 ?
Comment 1 Baptiste Wojtkowski (bwoj) 2024-07-03 10:54:52 UTC
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
Comment 2 Amaury GAU 2024-07-23 09:52:50 UTC
(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.
Comment 3 Baptiste Wojtkowski (bwoj) 2024-07-23 14:49:04 UTC
Bug was incorrectly reported and fix is breaking a working functionnality