Bug 39148 - Lists are incorrectly sorted in UNIMARC (OPAC follow-up)
Summary: Lists are incorrectly sorted in UNIMARC (OPAC follow-up)
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Baptiste Wojtkowski (bwoj)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-17 16:15 UTC by Baptiste Wojtkowski (bwoj)
Modified: 2025-05-12 16:32 UTC (History)
2 users (show)

See Also:
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 (1.76 KB, patch)
2025-04-25 10:29 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 39148: Correct sort by publicationdate in OPAC lists (1.76 KB, patch)
2025-04-25 12:18 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 39148: Correct sort by publicationdate in OPAC lists (1.82 KB, patch)
2025-04-25 13:02 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 39148: Correct sort by publicationdate in OPAC lists (1.88 KB, patch)
2025-05-12 11:21 UTC, Martin Renvoize (ashimema)
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) 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!