Bug 39276

Summary: OPACShowHoldQueueDetails datatable warning
Product: Koha Reporter: Laura Escamilla <Laura.escamilla>
Component: OPACAssignee: Lucas Gass (lukeg) <lucas>
Status: Pushed to stable --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: david, lucas, martin.renvoize, michael.adamyk, paul.derscheid, techservspec
Version: Main   
Hardware: All   
OS: All   
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,24.11.05
Circulation function:
Attachments: Bug 39276: Show record level priority in opac detail page
Bug 39276: Show record level priority in opac detail page
Bug 39276: Show record level priority in opac detail page

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!
Comment 11 Paul Derscheid 2025-05-22 18:24:47 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.05