Bugzilla – Attachment 162522 Details for
Bug 35963
Problem using some filters in the bundled items table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35963: Fix bundled items table ordering and filtering
Bug-35963-Fix-bundled-items-table-ordering-and-fil.patch (text/plain), 2.72 KB, created by
Victor Grousset/tuxayo
on 2024-02-28 04:56:27 UTC
(
hide
)
Description:
Bug 35963: Fix bundled items table ordering and filtering
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2024-02-28 04:56:27 UTC
Size:
2.72 KB
patch
obsolete
>From bf773b9487dc27d98c2e1a7d3e0051864725c363 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 7 Feb 2024 14:36:01 +0100 >Subject: [PATCH] Bug 35963: Fix bundled items table ordering and filtering > >Using the many-to-many relationship results in the table alias `me` to >be used for table `item_bundles` instead of the expected table `items`. >This causes ordering and filtering to fail for columns Callnumber and >Barcode. >Using Koha::Items->search does not have this problem. > >This patch also disables ordering by status because it does not work >(error message is: "Cannot find Koha::Object class for return_claim'") > >Test plan: >1. Create an item bundle > https://koha-community.org/manual/23.11/en/html/circulation.html#circulating-bundles >2. Add at least 2 items to this bundle >3. Verify that ordering/filtering by callnumber or barcode works >4. Run `prove t/db_dependent/api/v1/items/bundled_items.t` > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > Koha/REST/V1/Items.pm | 11 +++++++++-- > .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- > 2 files changed, 10 insertions(+), 3 deletions(-) > >diff --git a/Koha/REST/V1/Items.pm b/Koha/REST/V1/Items.pm >index 5db12b669d..69333c1bdf 100644 >--- a/Koha/REST/V1/Items.pm >+++ b/Koha/REST/V1/Items.pm >@@ -294,8 +294,15 @@ sub bundled_items { > } > > return try { >- my $items_set = $item->bundle_items; >- my $items = $c->objects->search( $items_set ); >+ my $items_set = Koha::Items->search( >+ { >+ 'item_bundles_item.host' => $item_id, >+ }, >+ { >+ join => 'item_bundles_item', >+ } >+ ); >+ my $items = $c->objects->search($items_set); > return $c->render( > status => 200, > openapi => $items >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 9764f45735..48f96e6c87 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -1907,7 +1907,7 @@ > "data": "lost_status:last_seen_date:return_claim.patron", > "title": _("Status"), > "searchable": false, >- "orderable": true, >+ "orderable": false, > "render": function(data, type, row, meta) { > if ( row.lost_status == bundle_lost_value ) { > let out = '<span class="lost">' + _("Last seen") + ': ' + $date(row.last_seen_date) + '</span>'; >-- >2.44.0
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 35963
:
161812
|
162521
|
162522
|
162523
|
162718
|
162719
|
162720