| Summary: | Cannot edit a list to have a sortfield value of anything other than publicationyear | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Lucas Gass (lukeg) <lucas> |
| Component: | Lists | Assignee: | Lucas Gass (lukeg) <lucas> |
| Status: | Needs documenting --- | QA Contact: | Paul Derscheid <paul.derscheid> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | angela.berrett, baptiste.wojtkowski, dcook, jeanne.mauriello, kebliss, m.de.rooy, mspinney, paul.derscheid |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Trivial patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: |
This fixes a problem where lists were un-sortable in the staff interface. It also fixes a problem where the sort value for a list was always being set to 'Publication year' when editing that list.
|
Version(s) released in: |
25.11.00,25.05.05
|
| Circulation function: | |||
| Bug Depends on: | 37434 | ||
| Bug Blocks: | |||
| Attachments: |
Bug 40916: Fix evaluation when editing a list
Bug 40916: Fix another occurance Bug 40916: Fix another occurance Bug 40916: Fix evaluation when editing a list Bug 40916: Fix another occurance |
||
|
Description
Lucas Gass (lukeg)
2025-09-30 19:44:00 UTC
This check:
if ( $sortfield == 'copyrightdate' and C4::Context->preference('marcflavour') == 'UNIMARC' ) {
It should use 'eq' to compare strings, not `==`.
Created attachment 187133 [details] [review] Bug 40916: Fix evaluation when editing a list 1. Create a list 2. Sort this list by: title 3. Save 4. Edit the list, changing the the "Sort this list by:" to copyrightdate 5. Try to edit it again to any other type of sort. Save 6. Look again, it is reverted to copyrightdate 7. APPLY PATCH, restart_all 8. Now when you edit the list any value you use in "Sort this list by:" should be retained. Created attachment 187137 [details] [review] Bug 40916: Fix another occurance With these patches applied lists should sort correctly. *** Bug 40487 has been marked as a duplicate of this bug. *** Created attachment 187222 [details] [review] Bug 40916: Fix another occurance Signed-off-by: Michelle <mspinney@clamsnet.org> Created attachment 187248 [details] [review] Bug 40916: Fix evaluation when editing a list 1. Create a list 2. Sort this list by: title 3. Save 4. Edit the list, changing the the "Sort this list by:" to copyrightdate 5. Try to edit it again to any other type of sort. Save 6. Look again, it is reverted to copyrightdate 7. APPLY PATCH, restart_all 8. Now when you edit the list any value you use in "Sort this list by:" should be retained. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 187249 [details] [review] Bug 40916: Fix another occurance Signed-off-by: Michelle <mspinney@clamsnet.org> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Wow, that one was really subtle! Good catch. I also noticed that the sort by dropdown in the main list table behaves weirdly but that's maybe for another bug. Nice work everyone! Pushed to main for 25.11 We've had a recent request by one of our branches to have this backported as soon as possible? Is that an option? Nice work everyone! Pushed to 25.05.x Depends on Bug 37434, not backported I also noticed that the main list table isn't sorting correctly. I click on the <<last>> link to get me to the most recent list I created. If I edit the list itself, for example, changing who can edit it, the list name in the list table sorts somewhere else. So we have lists called Form Adds 07/30 sorting after a Form Adds 10/30 list. The contents of the lists are now sorting correctly. |