Bug 39406 - Issues on serial collection page sort from old to new now
Summary: Issues on serial collection page sort from old to new now
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Aleisha Amohia
QA Contact: Katrin Fischer
URL:
Keywords: regression, rel_24_11_candidate
Depends on:
Blocks:
 
Reported: 2025-03-21 09:51 UTC by Katrin Fischer
Modified: 2025-05-19 08:00 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: Sponsored
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the serial collection table so that issues now sort in descending order based on the date published column (the latest issue at the top).
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39406: Make serial issues sort from new to old on collection page (1.73 KB, patch)
2025-05-15 04:53 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 39406: Make serial issues sort from new to old on collection page (1.78 KB, patch)
2025-05-18 18:39 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2025-03-21 09:51:51 UTC
The serial issues on the serial collection page used to sort from new to old, which meant that the issues you were most likely to edit were at the top. Now the table sorts from old to new, which leaves the new items in a long list at the bottom. The old sorting should be restored.
Comment 1 Jonathan Druart 2025-03-24 10:19:22 UTC
Can you provide a commit id where it was working?

I don't find anything in the git log that could cause a regression.

I guess the following changes would fix the problem:

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
index 67c39806aae..1e2f62b4746 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
@@ -361,7 +361,7 @@
             }
             $(".subscription-year-table").kohaTable({
                 columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }],
-                order: [[0, "desc"]],
+                order: [[3, "desc"]],
                 dom: "t",
                 autoWidth: false,
                 paginate: false,
Comment 2 Katrin Fischer 2025-04-06 08:49:41 UTC
I compared it with the latest 22.11 version as that was, what I had at hand immediately. The sorting there is different. KIT who reported was using 23.11 before I believe.
Comment 3 Michaela Sieber 2025-04-08 11:57:06 UTC
(In reply to Katrin Fischer from comment #2)
> I compared it with the latest 22.11 version as that was, what I had at hand
> immediately. The sorting there is different. KIT who reported was using
> 23.11 before I believe.

Yes we are using 23.11.06 and the order of serial issues is from new to old.
Comment 4 Michaela Sieber 2025-04-25 08:36:48 UTC
We seems that the problem is the column 0 (which is the column with the checkboxes)
As Jonathan mentioned this column should be sorted descending (which means it would be sorted by serialid desc)
Maybe this is a bug in the new DataTables version because column 0 ist declared as not sortable? 
The new DataTables version was intruduced in Koha version 24.11 (see bug 36640)

We suggest to sort the table by column 1, which is the date published.
It should NOT be sorted by column 3 because this is the date received.

To change the sorting to the publication date is comprehensible for users and it gives the user the opportunity to change the sorting of the serial issues by editing the Date published.
Comment 5 Aleisha Amohia 2025-05-15 04:53:04 UTC
Created attachment 182473 [details] [review]
Bug 39406: Make serial issues sort from new to old on collection page

This patch fixes the serial collection table to sort in descending order on the date published column.

To test:

1. Create a subscription if you don't already have one.
2. Go to the Serial Collection tab using the left navigation.
3. Click the Generate Next button a bunch of times to generate some serial issues. Note that the issues are displaying in the table in ascending order, with the oldest date published at the top.

4. Apply the patch and refresh the page

5. Confirm the issues are now displaying in the table in descending order, with the newest date published at the top.
6. Click the Generate Next button again and confirm the issue is inserted at the top of the table.

Sponsored-by: Pymble Ladies' College
Comment 6 Katrin Fischer 2025-05-15 05:36:53 UTC
Great to see a patch here! :)
Comment 7 David Nind 2025-05-18 18:39:10 UTC
Created attachment 182564 [details] [review]
Bug 39406: Make serial issues sort from new to old on collection page

This patch fixes the serial collection table to sort in descending order on the date published column.

To test:

1. Create a subscription if you don't already have one.
2. Go to the Serial Collection tab using the left navigation.
3. Click the Generate Next button a bunch of times to generate some serial issues. Note that the issues are displaying in the table in ascending order, with the oldest date published at the top.

4. Apply the patch and refresh the page

5. Confirm the issues are now displaying in the table in descending order, with the newest date published at the top.
6. Click the Generate Next button again and confirm the issue is inserted at the top of the table.

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>
Comment 8 Katrin Fischer 2025-05-19 07:50:17 UTC
Pushed for 25.05!

Well done everyone, thank you!