Created attachment 149467 [details] [review] Bug 33497: Use 'host_items' param to fetch all items at once This patch adjusts the detail page to fetch items and host items together, and prefetches transfers and checkouts To test: 1 - Enable easy analytics 2 - Attach some items to a bib 3 - Checkout an item on the bib 4 - View the details page 5 - Apply patch 6 - View details page, confirm nothing has changed
Created attachment 149468 [details] [review] Bug 33497: Add a filter relationship for branchtransfers This uses the new relationship from bug 33493 to fetch the transfers for items To test: 1 - Transfer some items on a bib 2 - View the biblio details page in the staff interface 3 - Apply patch 4 - Confirm the view is the same
Added assignee.
Created attachment 149573 [details] [review] Bug 33497: Use 'host_items' param to fetch all items at once This patch adjusts the detail page to fetch items and host items together, and prefetches transfers and checkouts To test: 1 - Enable easy analytics 2 - Attach some items to a bib 3 - Checkout an item on the bib 4 - View the details page 5 - Apply patch 6 - View details page, confirm nothing has changed Signed-off-by: David Nind <david@davidnind.com>
Created attachment 149574 [details] [review] Bug 33497: Add a filter relationship for branchtransfers This uses the new relationship from bug 33493 to fetch the transfers for items To test: 1 - Transfer some items on a bib 2 - View the biblio details page in the staff interface 3 - Apply patch 4 - Confirm the view is the same Signed-off-by: David Nind <david@davidnind.com>
Nick, I have a plan to rewrite the items table on the staff detail page to make it use the REST API. I will base my patches on top of this bug, but keep it in mind in case you would like to provide more things. Maybe we are going to collide :)
(In reply to Jonathan Druart from comment #6) > Nick, I have a plan to rewrite the items table on the staff detail page to > make it use the REST API. I will base my patches on top of this bug, but > keep it in mind in case you would like to provide more things. Maybe we are > going to collide :) Excellent! I had started trying to clean the page, then realized it would just be better to move to the API, so switched to setting the stage for that. Let me know if any of this set needs adjustment or how I can help. I won't file anymore touching this one for now :-)
+my $items = $biblio->items({ host_items => 1 })->search_ordered( $params, { prefetch => ['issue','branchtransfers'] } ); [...] +$dat->{'count'} = $biblio->items({ host_items => 1 })->count; +$dat->{'showncount'} = $items->count; Are not we going to always get count == showncount?
Nick answered me, itemlost is passed in $params
$dat->{'count'} = $biblio->items->count + $hostitems->count; Should we apply the same count (ie. include host items) in other catalogue scripts as well? See catalog-strings.inc var count = [% count | html %];
(In reply to Jonathan Druart from comment #10) > $dat->{'count'} = $biblio->items->count + $hostitems->count; > > Should we apply the same count (ie. include host items) in other catalogue > scripts as well? See catalog-strings.inc > var count = [% count | html %]; moredetail needs it, the other areas using catalog-strings don't actually seemd to display count or items
+if (C4::Context->preference("AlternateHoldingsField") && scalar $items->count == 0) { scalar should be removed here.
Created attachment 151861 [details] [review] Bug 33497: Use 'host_items' param to fetch all items at once This patch adjusts the detail page to fetch items and host items together, and prefetches transfers and checkouts To test: 1 - Enable easy analytics 2 - Attach some items to a bib 3 - Checkout an item on the bib 4 - View the details page 5 - Apply patch 6 - View details page, confirm nothing has changed Signed-off-by: David Nind <david@davidnind.com>
Created attachment 151862 [details] [review] Bug 33497: Add a filter relationship for branchtransfers This uses the new relationship from bug 33493 to fetch the transfers for items To test: 1 - Transfer some items on a bib 2 - View the biblio details page in the staff interface 3 - Apply patch 4 - Confirm the view is the same Signed-off-by: David Nind <david@davidnind.com>
Created attachment 151863 [details] [review] Bug 33497: (follow-up) Remove unecessary scalar
Created attachment 151866 [details] [review] Bug 33497: (follow-up) Adjust relationship name from bug 33493
Created attachment 153046 [details] [review] Bug 33497: Use 'host_items' param to fetch all items at once This patch adjusts the detail page to fetch items and host items together, and prefetches transfers and checkouts To test: 1 - Enable easy analytics 2 - Attach some items to a bib 3 - Checkout an item on the bib 4 - View the details page 5 - Apply patch 6 - View details page, confirm nothing has changed Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 153047 [details] [review] Bug 33497: Add a filter relationship for branchtransfers This uses the new relationship from bug 33493 to fetch the transfers for items To test: 1 - Transfer some items on a bib 2 - View the biblio details page in the staff interface 3 - Apply patch 4 - Confirm the view is the same Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 153048 [details] [review] Bug 33497: (follow-up) Remove unecessary scalar Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 153049 [details] [review] Bug 33497: (follow-up) Adjust relationship name from bug 33493 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 23.11. Nice work everyone, thanks!
Created attachment 153183 [details] [review] Bug 33497: Don't get host items if the MARC record is invalid When don't want to explode with "invalid data" later so we need to condition the host_item search call trace was Koha::Biblio::Metadata::record('Koha::Biblio::Metadata=HASH(0x55ab92e60120)') called at /kohadevbox/koha/Koha/Biblio.pm line 538 Koha::Biblio::_host_itemnumbers('Koha::Biblio=HASH(0x55ab92e4d5c0)') called at /kohadevbox/koha/Koha/Biblio.pm line 498 Koha::Biblio::items('Koha::Biblio=HASH(0x55ab92e4d5c0)', 'HASH(0x55ab934615d8)') called at /kohadevbox/koha/catalogue/detail.pl line 200 This is fixing t/db_dependent/selenium/regressions.t
(In reply to Jonathan Druart from comment #22) > Created attachment 153183 [details] [review] [review] > Bug 33497: Don't get host items if the MARC record is invalid > > When don't want to explode with "invalid data" later so we need to > condition the host_item search > > call trace was > > Koha::Biblio::Metadata::record('Koha::Biblio:: > Metadata=HASH(0x55ab92e60120)') called at /kohadevbox/koha/Koha/Biblio.pm > line 538 > Koha::Biblio::_host_itemnumbers('Koha::Biblio=HASH(0x55ab92e4d5c0)') > called at /kohadevbox/koha/Koha/Biblio.pm line 498 > Koha::Biblio::items('Koha::Biblio=HASH(0x55ab92e4d5c0)', > 'HASH(0x55ab934615d8)') called at /kohadevbox/koha/catalogue/detail.pl line > 200 > > This is fixing t/db_dependent/selenium/regressions.t Follow-up pushed. Thanks, Jonathan!
Thanks for all the hard work! Pushed to 23.05.x for the next release
Nice work everyone! Pushed to oldstable for 22.11.x
Backport to 22.11.x reverted - a missing dependency in the tree (33167) has been identified