Bug 35006

Summary: OPAC holdings table - sort for current library column doesn't work
Product: Koha Reporter: David Nind <david>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: Pushed to oldstable --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, michaela.sieber
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35319
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the holdings table on the OPAC's bibliographic detail page so that home and current library columns are sorted correctly by library name.
Version(s) released in:
23.11.00,23.05.05,22.11.12
Bug Depends on: 29144, 31313    
Bug Blocks:    
Attachments: Bug 35006: OPAC holdings table - Fix sort for library columns
Bug 35006: OPAC holdings table - Fix sort for library columns
Bug 35006: OPAC holdings table - Fix sort for library columns

Description David Nind 2023-10-08 18:30:57 UTC
In the OPAC, the sort by 'Current library' in the holdings table for a record doesn't work.

Sorting of other columns seem to work okay (change one of the item types for an item, collection code, and add different call numbers to test).

To replicate:
1. Go to a record in the OPAC that has multiple items in different libraries (126 - Intermediate Perl has four items in three different libraries).
2. In the holdings tab, click the 'Current library' column.
3. Note that the sort order doesn't change.
Comment 1 Katrin Fischer 2023-10-09 20:44:49 UTC
Confirmed the bug, but not sure what the problem is :(
Comment 2 Owen Leonard 2023-10-10 13:37:55 UTC
Created attachment 156797 [details] [review]
Bug 35006: OPAC holdings table - Fix sort for library columns

This patch updates the holdings table on the OPAC's bibliographic detail
page so that home and current library columns can be sorted correctly by
library name. There have been changes to the way the template shows
these values, but the DataTables "data-sort" attribute on the table cell
had not been updated accordingly.

To test, apply the patch set the OpacLocationBranchToDisplay system
preference to "home and holding libraries."

- Make sure home and holding library columns are not hidden in the
  table settings under Administration -> Table settings -> OPAC ->
  holdingst.
- Locate a bibliographic record in the OPAC which has multiple items
  from different libraries.
- Test that the home and current library columns sort correctly by
  library name.
Comment 3 David Nind 2023-10-10 18:38:32 UTC
Created attachment 156804 [details] [review]
Bug 35006: OPAC holdings table - Fix sort for library columns

This patch updates the holdings table on the OPAC's bibliographic detail
page so that home and current library columns can be sorted correctly by
library name. There have been changes to the way the template shows
these values, but the DataTables "data-sort" attribute on the table cell
had not been updated accordingly.

To test, apply the patch set the OpacLocationBranchToDisplay system
preference to "home and holding libraries."

- Make sure home and holding library columns are not hidden in the
  table settings under Administration -> Table settings -> OPAC ->
  holdingst.
- Locate a bibliographic record in the OPAC which has multiple items
  from different libraries.
- Test that the home and current library columns sort correctly by
  library name.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2023-10-10 18:38:51 UTC
Thanks Owen!
Comment 5 Nick Clemens (kidclamp) 2023-10-11 18:07:44 UTC
Created attachment 156873 [details] [review]
Bug 35006: OPAC holdings table - Fix sort for library columns

This patch updates the holdings table on the OPAC's bibliographic detail
page so that home and current library columns can be sorted correctly by
library name. There have been changes to the way the template shows
these values, but the DataTables "data-sort" attribute on the table cell
had not been updated accordingly.

To test, apply the patch set the OpacLocationBranchToDisplay system
preference to "home and holding libraries."

- Make sure home and holding library columns are not hidden in the
  table settings under Administration -> Table settings -> OPAC ->
  holdingst.
- Locate a bibliographic record in the OPAC which has multiple items
  from different libraries.
- Test that the home and current library columns sort correctly by
  library name.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Tomás Cohen Arazi 2023-10-18 13:23:31 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-10-25 06:33:29 UTC
Pushed to 23.05.x for 23.05.05
Comment 8 Matt Blenkinsop 2023-11-13 13:46:12 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x