Bug 35319

Summary: Default sorting of the holdings table with OPACHoldingsDefaultSortField is broken
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: david, jonathan.druart, michaela.sieber, schodkowy.omegi-0r
Version: MainKeywords: regression
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35006
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30633
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 16759    
Bug Blocks:    

Description Katrin Fischer 2023-11-13 13:02:20 UTC
No matter which setting is chosen, the sorting remains on the itemtype column. If the item type column is hidden via table settings, it still seems to apply. None of the other columns shows as sorted judging from the small arrow icons on top.

Confirmed in 23.05 and 22.11.
Comment 1 Jonathan Druart 2024-03-19 09:03:05 UTC
./opac-detail.tt ~ l.1806

it's creating default_order_index that is never used later
Comment 2 MichaƂ 2024-07-22 08:42:14 UTC
The problem is that ever since this commit: https://github.com/Koha-Community/Koha/commit/92f6f5b049cc6a45917465f87efa93d51ff81a4a

...the preference OPACHoldingsDefaultSortField is dead. It sets a JavaScript variable based on it in the template, but that variable is not used anywhere anymore.

Right now no sorting is defined, meaning the holdings should actually be sorted by the itemnumber from the items table. The claim that it's sorted by itemtype column should be all but coincidental, can you confirm that?

I guess the solution is to either remove that preference to not confuse people or to re-create it in a way that any column could be specified, such as copy number, callnumber and so on, setting it as "first column" sucked anyway.
Comment 3 Katrin Fischer 2024-07-29 09:32:46 UTC
Hm, a sort by itemnumber is less than ideal as it will produce a "wild mix" that is not clear to the user at all. I am updating severity.