Bug 41451: Prevent 500 when searching hold history

It explodes if the "Item type" column is displayed (ie. if
AllowHoldItemTypeSelection is set).

Test plan:
1) Create at least one hold on any record
2) Navigate to the patron who has the hold and click Holds history in the left menu
3) The table should load correctly and the search bar above it should work
4) In system preferences, enable AllowHoldItemTypeSelection
5) Refresh the holds history, the Requested item type column should now be visible
6) Try a search, a 500 error should be thrown
7) Apply patch
8) Repeat step 5, the search should now work correctly

Note that a couple of other bugs will be fixed on follow-up bug reports.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6d491b2d95)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This commit is contained in:
Jonathan Druart 2025-12-16 11:40:25 +01:00 committed by Jacob O'Mara
parent a5d9d82b6e
commit e96aba99e6
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -298,12 +298,12 @@
},
[% IF show_itemtype_column %]
{
data: "item_type.item_type",
data: "item_type",
searchable: true,
orderable: true,
render: function (data, type, row, meta) {
if ( row.item_type ) {
return row.item_type.item_type;
return row.item_type;
} else {
return _("Any item type");
}