Bug 39276 - OPACShowHoldQueueDetails datatable warning
Summary: OPACShowHoldQueueDetails datatable warning
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords: rel_24_11_candidate
Depends on:
Blocks:
 
Reported: 2025-03-07 17:08 UTC by Laura Escamilla
Modified: 2025-05-16 16:39 UTC (History)
5 users (show)

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


Attachments
Bug 39276: Show record level priority in opac detail page (1.41 KB, patch)
2025-04-15 22:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 39276: Show record level priority in opac detail page (1.45 KB, patch)
2025-04-19 09:18 UTC, David Nind
Details | Diff | Splinter Review
Bug 39276: Show record level priority in opac detail page (1.52 KB, patch)
2025-05-09 14:22 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Laura Escamilla 2025-03-07 17:08:15 UTC
To test:
1. Enable Holds history system preference and set the OPACShowHoldQueueDetails to "Show holds and their priority level". 
2. Place an item on hold. 
3. Log in to your OPAC and go to your Holds history tab. 
4. Click on your hold that is marked as "Pending". 
5. Notice that a datatable warning appears similar to:
  "DataTables warning: table id=holdingst - Requested unknown parameter '6' for row 0, column 6. For more information about this error, please see https://datatables.net/tn/4"
Comment 1 Owen Leonard 2025-03-08 15:33:53 UTC
This is in main? I'm not seeing an error with any setting of OPACShowHoldQueueDetails.
Comment 2 Owen Leonard 2025-03-08 15:43:26 UTC
(In reply to Owen Leonard from comment #1)
> This is in main? I'm not seeing an error with any setting of
> OPACShowHoldQueueDetails.

Whoops never mind, I see it now!
Comment 3 David Kuhn 2025-04-08 23:45:40 UTC
This error seems to occur on "Next available" holds where there are no item specific holds on the first item shown in the holdings list for the title. Perhaps it's related to the "item hold queue priority" being blank on the first item?
Comment 4 Lucas Gass (lukeg) 2025-04-15 22:20:14 UTC
There seems to be no reason to show the column at all if there are no item level holds. You shouldn't be able to mix item level and record level holds. 

Then we don't need to pass show_priority to the template either.
Comment 5 Lucas Gass (lukeg) 2025-04-15 22:28:28 UTC
(In reply to Lucas Gass (lukeg) from comment #4)
> There seems to be no reason to show the column at all if there are no item
> level holds. You shouldn't be able to mix item level and record level holds. 
> 
> Then we don't need to pass show_priority to the template either.

Nevermind, we pass priority when the hold is not item level:

 623             $hold->itemnumber
 624                 ? ( $priority{ $hold->itemnumber } = $hold->priority )
 625                 : ( $template->param( priority => $hold->priority ) );


We just need to show it in the template.
Comment 6 Lucas Gass (lukeg) 2025-04-15 22:32:58 UTC
Created attachment 180996 [details] [review]
Bug 39276: Show record level priority in opac detail page

To test:
1. Enable Holds history system preference and set the OPACShowHoldQueueDetails to "Show holds and their priority level".
2. Make an item level hold on a record.
3. Make a record level hold on a different record.
4. Login to the OPAC as that patron
5. On the detail page for the item level hold, it works
6. On the detail page for the record level hold, dataTable error
7. APPLY PATCH
8. Try each of the OPAC detail pages again, they should both work.
Comment 7 David Nind 2025-04-19 09:18:29 UTC
Created attachment 181206 [details] [review]
Bug 39276: Show record level priority in opac detail page

To test:
1. Enable Holds history system preference and set the OPACShowHoldQueueDetails to "Show holds and their priority level".
2. Make an item level hold on a record.
3. Make a record level hold on a different record.
4. Login to the OPAC as that patron
5. On the detail page for the item level hold, it works
6. On the detail page for the record level hold, dataTable error
7. APPLY PATCH
8. Try each of the OPAC detail pages again, they should both work.

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2025-04-19 09:20:38 UTC
Testing notes:
1. Step 1 - Enable the holds history system preference: OPACHoldsHistory
Comment 9 Martin Renvoize (ashimema) 2025-05-09 14:22:31 UTC
Created attachment 182181 [details] [review]
Bug 39276: Show record level priority in opac detail page

To test:
1. Enable Holds history system preference and set the OPACShowHoldQueueDetails to "Show holds and their priority level".
2. Make an item level hold on a record.
3. Make a record level hold on a different record.
4. Login to the OPAC as that patron
5. On the detail page for the item level hold, it works
6. On the detail page for the record level hold, dataTable error
7. APPLY PATCH
8. Try each of the OPAC detail pages again, they should both work.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 10 Katrin Fischer 2025-05-12 16:32:07 UTC
Pushed for 25.05!

Well done everyone, thank you!