Bugzilla – Attachment 127942 Details for
Bug 29495
Issue link is lost in return claims when using 'MarkLostItemsAsReturned'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29495: Update relationship methods
Bug-29495-Update-relationship-methods.patch (text/plain), 2.43 KB, created by
Martin Renvoize (ashimema)
on 2021-11-22 18:00:50 UTC
(
hide
)
Description:
Bug 29495: Update relationship methods
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-22 18:00:50 UTC
Size:
2.43 KB
patch
obsolete
>From 97cf59581a4deee70b22ff690332ffe37cdb4f72 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 18 Nov 2021 07:43:44 +0000 >Subject: [PATCH] Bug 29495: Update relationship methods > >This patch updates the relationship methods found in >Koha::Checkouts::ReturnClaim so that they are prefetchable and embeddable on >the API. > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >--- > Koha/Checkouts/ReturnClaim.pm | 18 +++++++++++++++--- > Koha/Schema/Result/ReturnClaim.pm | 8 ++++---- > 2 files changed, 19 insertions(+), 7 deletions(-) > >diff --git a/Koha/Checkouts/ReturnClaim.pm b/Koha/Checkouts/ReturnClaim.pm >index b8569beea5..c57a8c05c0 100644 >--- a/Koha/Checkouts/ReturnClaim.pm >+++ b/Koha/Checkouts/ReturnClaim.pm >@@ -66,6 +66,7 @@ sub store { > return $self->SUPER::store; > } > >+ > =head3 checkout > > =cut >@@ -73,10 +74,21 @@ sub store { > sub checkout { > my ($self) = @_; > >- my $checkout = Koha::Checkouts->find( $self->issue_id ) >- || Koha::Old::Checkouts->find( $self->issue_id ); >+ my $checkout_rs = $self->_result->checkout; >+ return unless $checkout_rs; >+ return Koha::Checkout->_new_from_dbic($checkout_rs); >+} >+ >+=head3 old_checkout >+ >+=cut >+ >+sub old_checkout { >+ my ($self) = @_; > >- return $checkout; >+ my $old_checkout_rs = $self->_result->old_checkout; >+ return unless $old_checkout_rs; >+ return Koha::Old::Checkout->_new_from_dbic($old_checkout_rs); > } > > =head3 patron >diff --git a/Koha/Schema/Result/ReturnClaim.pm b/Koha/Schema/Result/ReturnClaim.pm >index 89c6f3e114..4e2c56c40b 100644 >--- a/Koha/Schema/Result/ReturnClaim.pm >+++ b/Koha/Schema/Result/ReturnClaim.pm >@@ -280,7 +280,7 @@ __PACKAGE__->belongs_to( > # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-11-17 10:01:24 > # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ik93SD3kLNecIyRgsBVKDQ > >-=head2 issue >+=head2 checkout > > Type: belongs_to > >@@ -289,7 +289,7 @@ Related object: L<Koha::Schema::Result::Issue> > =cut > > __PACKAGE__->belongs_to( >- "issue", >+ "checkout", > "Koha::Schema::Result::Issue", > { issue_id => "issue_id" }, > { >@@ -298,7 +298,7 @@ __PACKAGE__->belongs_to( > }, > ); > >-=head2 old_issue >+=head2 old_checkout > > Type: belongs_to > >@@ -307,7 +307,7 @@ Related object: L<Koha::Schema::Result::OldIssue> > =cut > > __PACKAGE__->belongs_to( >- "old_issue", >+ "old_checkout", > "Koha::Schema::Result::OldIssue", > { issue_id => "issue_id" }, > { >-- >2.20.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 29495
:
127711
|
127712
|
127713
|
127714
|
127765
|
127766
|
127767
|
127768
|
127769
|
127809
|
127810
|
127811
|
127812
|
127813
|
127937
|
127938
|
127939
|
127940
|
127941
|
127942
|
127943
|
127944
|
129105
|
129106
|
129107
|
129109
|
129110
|
129111
|
129112
|
129113
|
129547
|
129575
|
129582
|
130460
|
130461
|
130462
|
130463
|
130464
|
130465
|
130466
|
130467
|
130752
|
130753
|
130754
|
130755
|
130756
|
130757
|
130758