TO recreate: 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
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