Bug 37178 - Column "comments" in ILL requests table gives error on sorting, paging cannot be changed
Summary: Column "comments" in ILL requests table gives error on sorting, paging cannot...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Pedro Amorim
QA Contact: Paul Derscheid
URL:
Keywords:
Depends on: 36904
Blocks:
  Show dependency treegraph
 
Reported: 2024-06-25 08:10 UTC by Katrin Fischer
Modified: 2024-11-12 16:55 UTC (History)
5 users (show)

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


Attachments
Bug 37178: Disable sorting on comments column (948 bytes, patch)
2024-07-01 10:30 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 37178: Disable sorting on comments column (1005 bytes, patch)
2024-09-30 22:03 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37178: Disable sorting on comments column (1.04 KB, patch)
2024-11-12 12:43 UTC, Paul Derscheid
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2024-06-25 08:10:38 UTC
The ILL requests table on the front page of the ILL module gives an error when the table is sorted on the column "Comments".

There is another error when switching the records per page to any other value than 20. 

This is from the developer tools:

DataTables warning: table id=ill-requests - Ajax error. For more information about this error, please see http://datatables.net/tn/7 datatables_23.1106000.js:467:13
Source map error: Error: request failed with status 404
Resource URL: .../intranet-tmpl/lib/datatables/datatables.min_23.1106000.js
Source Map URL: pdfmake.min.js.map

GET
.../api/v1/ill/requests?_page=1&_per_page=100&_match=contains&_order_by=+me.comments_count
REsponse: Internal server error

Tested in Koha 23.11, might need confirmation in newer versions.
Comment 1 Pedro Amorim 2024-07-01 10:30:26 UTC
Created attachment 168311 [details] [review]
Bug 37178: Disable sorting on comments column
Comment 2 Pedro Amorim 2024-07-01 10:33:40 UTC
The 'easy' fix here is to disable sorting on the column as that is a count processed value and not a value directly present on the ILL request table row. It may be easier than I think to implement sorting on that column but I don't have the time to invest in it at this point, happy to look at others suggestions here.

I think the other error you mention about the records per page is a non-issue as I believe it only occurs once you've sorted by comments first, i.e. if you refresh the page and change the records per page it works fine.
Comment 3 Katrin Fischer 2024-07-01 11:30:33 UTC
I think deactivating sorting for that column would be fine for now if it makes the unfriendly errors go away. We can still revisit later.
Comment 4 Lucas Gass (lukeg) 2024-09-30 22:03:51 UTC
Created attachment 172242 [details] [review]
Bug 37178: Disable sorting on comments column

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Pedro Amorim 2024-11-12 12:09:39 UTC
Adding others here as it's a very trivial fix needing PQA.
Comment 6 Paul Derscheid 2024-11-12 12:43:37 UTC
Created attachment 174407 [details] [review]
Bug 37178: Disable sorting on comments column

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 7 Katrin Fischer 2024-11-12 16:55:30 UTC
Pushed for 24.11!

Well done everyone, thank you!