Bug 39148

Summary: Lists are incorrectly sorted in UNIMARC (OPAC follow-up)
Product: Koha Reporter: Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski>
Component: OPACAssignee: Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski>
Status: Pushed to main --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: trivial    
Priority: P5 - low CC: martin.renvoize, roman.dolny
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:
Attachments: Bug 39148: Correct sort by publicationdate in OPAC lists
Bug 39148: Correct sort by publicationdate in OPAC lists
Bug 39148: Correct sort by publicationdate in OPAC lists
Bug 39148: Correct sort by publicationdate in OPAC lists

Description Baptiste Wojtkowski (bwoj) 2025-02-17 16:15:54 UTC
Bug 37434 did address the problem of lists incorrectly sorted for Intranet. We also need to address it for the OPAC

Steps to reproduce :
1 - Log in to an UNIMARC instance of Koha
2 - Create a public list with items with different publication date and sort it by publication date
3 - Go to the OPAC and click on List -> <your list>
It should be unordered
Comment 1 Baptiste Wojtkowski (bwoj) 2025-04-25 10:29:25 UTC
Created attachment 181500 [details] [review]
Bug 39148: Correct sort by publicationdate in OPAC lists

Test plan (UNIMARC):
1 - Create a list with different publicationdates, chose to sort it by
  copyright gate
2 - Go to the list in the OPAC -> it is not correctly sorted
3 - Pick sort order: copyright date -> not correctly sorted
4 - Apply patch
5 - Retry 2&3 and see it works
Comment 2 Roman Dolny 2025-04-25 12:02:43 UTC
It works as described in test plan, but comparison operators need to be adjust to string -- plack-opac-error.log says:

[2025/04/25 11:53:37] [WARN] Argument "copyrightdate" isn't numeric in numeric eq (==) at /kohadevbox/koha/opac/opac-shelves.pl.
[2025/04/25 11:53:37] [WARN] Argument "title" isn't numeric in numeric eq (==) at /kohadevbox/koha/opac/opac-shelves.pl line 3.
[2025/04/25 11:53:37] [WARN] Argument "UNIMARC" isn't numeric in numeric eq (==) at /kohadevbox/koha/opac/opac-shelves.pl line3.
[2025/04/25 11:53:37] [WARN] Argument "UNIMARC" isn't numeric in numeric eq (==) at /kohadevbox/koha/opac/opac-shelves.pl line3.
Comment 3 Baptiste Wojtkowski (bwoj) 2025-04-25 12:18:47 UTC
Created attachment 181508 [details] [review]
Bug 39148: Correct sort by publicationdate in OPAC lists

Test plan (UNIMARC):
1 - Create a list with different publicationdates, chose to sort it by
  copyright gate
2 - Go to the list in the OPAC -> it is not correctly sorted
3 - Pick sort order: copyright date -> not correctly sorted
4 - Apply patch
5 - Retry 2&3 and see it works
Comment 4 Roman Dolny 2025-04-25 13:02:58 UTC
Created attachment 181527 [details] [review]
Bug 39148: Correct sort by publicationdate in OPAC lists

Test plan (UNIMARC):
1 - Create a list with different publicationdates, chose to sort it by
  copyright gate
2 - Go to the list in the OPAC -> it is not correctly sorted
3 - Pick sort order: copyright date -> not correctly sorted
4 - Apply patch
5 - Retry 2&3 and see it works

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 5 Martin Renvoize (ashimema) 2025-05-12 11:21:23 UTC
Created attachment 182257 [details] [review]
Bug 39148: Correct sort by publicationdate in OPAC lists

Test plan (UNIMARC):
1 - Create a list with different publicationdates, chose to sort it by
  copyright gate
2 - Go to the list in the OPAC -> it is not correctly sorted
3 - Pick sort order: copyright date -> not correctly sorted
4 - Apply patch
5 - Retry 2&3 and see it works

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 6 Katrin Fischer 2025-05-12 16:32:04 UTC
Pushed for 25.05!

Well done everyone, thank you!