[Bug 33497] New: Reduce DB calls on staff detail page
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Bug ID: 33497 Summary: Reduce DB calls on staff detail page Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 149467 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149467&action=edit 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 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 149468 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149468&action=edit 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 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33167, 33496, 33493 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33167 [Bug 33167] Bibs with several hundred items causes a slow loading screen https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33493 [Bug 33493] Add a filter relationship for branchtransfers https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33496 [Bug 33496] Add 'host_items' param to Koha::Biblio->items -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | --- Comment #3 from David Nind <david@davidnind.com> --- Added assignee. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149467|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 149573 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149573&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149468|0 |1 is obsolete| | --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 149574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149574&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.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 :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- (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 :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- +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? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Nick answered me, itemlost is passed in $params -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- $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 %]; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- (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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |33568 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33568 [Bug 33568] Use the REST API to display items on the biblio detail view -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- +if (C4::Context->preference("AlternateHoldingsField") && scalar $items->count == 0) { scalar should be removed here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149573|0 |1 is obsolete| | Attachment #149574|0 |1 is obsolete| | --- Comment #13 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 151861 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151861&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 151862 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151862&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #15 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 151863 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151863&action=edit Bug 33497: (follow-up) Remove unecessary scalar -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #16 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 151866 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151866&action=edit Bug 33497: (follow-up) Adjust relationship name from bug 33493 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Bug 33497 depends on bug 33493, which changed state. Bug 33493 Summary: Add a filter relationship for branchtransfers https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33493 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151861|0 |1 is obsolete| | Attachment #151862|0 |1 is obsolete| | Attachment #151863|0 |1 is obsolete| | Attachment #151866|0 |1 is obsolete| | --- Comment #17 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153046 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153046&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #18 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153047 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153047&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #19 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153048 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153048&action=edit Bug 33497: (follow-up) Remove unecessary scalar Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #20 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153049 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153049&action=edit Bug 33497: (follow-up) Adjust relationship name from bug 33493 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #22 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153183 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153183&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #23 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #22)
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
Follow-up pushed. Thanks, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00 |23.11.00,23.05.02 released in| | Status|Pushed to master |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #24 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for all the hard work! Pushed to 23.05.x for the next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00,23.05.02 |23.11.00,23.05.02,22.11.08 released in| | Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 --- Comment #25 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |ASSIGNED CC| |matt.blenkinsop@ptfs-europe | |.com Version(s)|23.11.00,23.05.02,22.11.08 |23.11.00,23.05.02 released in| | --- Comment #26 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Backport to 22.11.x reverted - a missing dependency in the tree (33167) has been identified -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Bug 33497 depends on bug 33167, which changed state. Bug 33167 Summary: Cleanup staff interface catalog details page https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33167 What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Bug 33497 depends on bug 33496, which changed state. Bug 33496 Summary: Add 'host_items' param to Koha::Biblio->items https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33496 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34639 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 [Bug 34639] Item shown in transit on detail.pl even if marked as arrived or cancelled -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34360 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34360 [Bug 34360] [WARN] DBIx::Class::ResultSetColumn::new(): Attempting to retrieve non-unique column 'biblionumber' on a resultset containing one-to-many joins will return duplicate results -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org