Bugzilla – Attachment 190519 Details for
Bug 41451
Hold history search fails when itemtype column present
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41451: Set correct embed and column property for itemtypes in the holds history table
Bug-41451-Set-correct-embed-and-column-property-fo.patch (text/plain), 3.48 KB, created by
Matt Blenkinsop
on 2025-12-15 17:06:34 UTC
(
hide
)
Description:
Bug 41451: Set correct embed and column property for itemtypes in the holds history table
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-12-15 17:06:34 UTC
Size:
3.48 KB
patch
obsolete
>From b61c3f729c5a89612241519d7439b9205feac428 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Mon, 15 Dec 2025 17:04:18 +0000 >Subject: [PATCH] Bug 41451: Set correct embed and column property for > itemtypes in the holds history table > >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 and run yarn api:bundle && restart_all >8) Repeat step 5, the search should now work correctly >--- > Koha/Schema/Result/Item.pm | 7 +++++++ > api/v1/swagger/paths/patrons_holds.yaml | 1 + > .../intranet-tmpl/prog/en/modules/members/holdshistory.tt | 8 ++++---- > 3 files changed, 12 insertions(+), 4 deletions(-) > >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index 83b361a1400..cd102c796fd 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -1082,6 +1082,13 @@ __PACKAGE__->might_have( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+__PACKAGE__->belongs_to( >+ "itemtype", >+ "Koha::Schema::Result::Itemtype", >+ { "foreign.itemtype" => "self.itype" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > use C4::Context; > > =head2 effective_itemtype >diff --git a/api/v1/swagger/paths/patrons_holds.yaml b/api/v1/swagger/paths/patrons_holds.yaml >index b8c28f30d83..87a53ebe504 100644 >--- a/api/v1/swagger/paths/patrons_holds.yaml >+++ b/api/v1/swagger/paths/patrons_holds.yaml >@@ -33,6 +33,7 @@ > - biblio > - deleted_biblio > - item >+ - item.itemtype > - pickup_library > collectionFormat: csv > produces: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >index 3fa944bdcf0..c49172acf2e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >@@ -203,7 +203,7 @@ > }; > > let table_url = '/api/v1/patrons/[% patron.borrowernumber | uri %]/holds'; >- let table_embeds = ['+strings', 'biblio', 'item', 'pickup_library']; >+ let table_embeds = ['+strings', 'biblio', 'item', 'item.itemtype', 'pickup_library']; > if (old){ > table_url += '?old=1'; > table_embeds.push('deleted_biblio'); >@@ -298,12 +298,12 @@ > }, > [% IF show_itemtype_column %] > { >- data: "item_type.item_type", >+ data: "item.itemtype.description", > searchable: true, > orderable: true, > render: function (data, type, row, meta) { >- if ( row.item_type ) { >- return row.item_type.item_type; >+ if ( row.item.itemtype ) { >+ return row.item.itemtype.description; > } else { > return _("Any item type"); > } >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41451
:
190519
|
190532
|
190533
|
190536
|
190552