Bugzilla – Attachment 152090 Details for
Bug 32894
Objects cache methods' result without invalidation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32894: Remove incorrect caching from bundle_items
Bug-32894-Remove-incorrect-caching-from-bundleitem.patch (text/plain), 1.62 KB, created by
Jonathan Druart
on 2023-06-07 10:04:10 UTC
(
hide
)
Description:
Bug 32894: Remove incorrect caching from bundle_items
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-06-07 10:04:10 UTC
Size:
1.62 KB
patch
obsolete
>From 9fa06b7aeb32271f7a0169af1aea497a10c0c374 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 21 Apr 2023 11:18:35 +0100 >Subject: [PATCH] Bug 32894: Remove incorrect caching from bundle_items > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Item.pm | 11 ++--------- > Koha/Schema/Result/Item.pm | 3 +++ > 2 files changed, 5 insertions(+), 9 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 0e951dee90d..542e52a7ccc 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1622,15 +1622,8 @@ Returns the items associated with this bundle > sub bundle_items { > my ($self) = @_; > >- if ( !$self->{_bundle_items_cached} ) { >- my $bundle_items = Koha::Items->search( >- { 'item_bundles_item.host' => $self->itemnumber }, >- { join => 'item_bundles_item' } ); >- $self->{_bundle_items} = $bundle_items; >- $self->{_bundle_items_cached} = 1; >- } >- >- return $self->{_bundle_items}; >+ my $rs = $self->_result->bundle_items; >+ return Koha::Items->_new_from_dbic($rs); > } > > =head3 is_bundle >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index d29296b77e5..980ea046c4a 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -982,6 +982,9 @@ __PACKAGE__->has_many( > } > ); > >+# Relationship with bundled items >+__PACKAGE__->many_to_many( bundle_items => 'item_bundles_hosts', 'item' ); >+ > __PACKAGE__->might_have( > "last_returned_by", > "Koha::Schema::Result::ItemsLastBorrower", >-- >2.25.1
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 32894
:
147499
|
147500
|
147502
|
147503
|
150016
|
150017
|
150018
|
150019
|
150020
|
150021
|
150827
|
150828
|
150847
|
150848
|
150849
|
150850
|
150851
|
150852
|
150853
|
150854
|
150855
|
152086
|
152087
|
152088
|
152089
| 152090 |
152091
|
152092
|
152093
|
152094