Bugzilla – Attachment 129547 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: (follow-up) Fix Tests
Bug-29495-follow-up-Fix-Tests.patch (text/plain), 2.23 KB, created by
Martin Renvoize (ashimema)
on 2022-01-18 11:41:36 UTC
(
hide
)
Description:
Bug 29495: (follow-up) Fix Tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-01-18 11:41:36 UTC
Size:
2.23 KB
patch
obsolete
>From 803ad345fde382ceb66cda5db7ef99634edc055f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 18 Jan 2022 11:29:59 +0000 >Subject: [PATCH] Bug 29495: (follow-up) Fix Tests > >Update DBIC relation types to prevent double issue creation during >object build. >--- > Koha/Schema/Result/ReturnClaim.pm | 24 ++++++++++++++++++------ > 1 file changed, 18 insertions(+), 6 deletions(-) > >diff --git a/Koha/Schema/Result/ReturnClaim.pm b/Koha/Schema/Result/ReturnClaim.pm >index 9e67c7f0e7..49ded3b9f9 100644 >--- a/Koha/Schema/Result/ReturnClaim.pm >+++ b/Koha/Schema/Result/ReturnClaim.pm >@@ -282,16 +282,22 @@ __PACKAGE__->belongs_to( > > =head2 checkout > >-Type: belongs_to >+Type: has_many but should be belongs_to >+ >+To get around TestBuilder failures we set this relation to has_many as it >+allows us to produce the same query without triggering TestBuilder failures >+(when it tries to create the issue twice, once for the checkout and once for >+the old_checkouts relation below). might_have would also be more appropriate, >+but this triggers a DBIC warning as the key field here is nullable. > > Related object: L<Koha::Schema::Result::Issue> > > =cut > >-__PACKAGE__->belongs_to( >+__PACKAGE__->has_many( > "checkout", > "Koha::Schema::Result::Issue", >- { issue_id => "issue_id" }, >+ { "foreign.issue_id" => "self.issue_id" }, > { > is_deferrable => 1, > join_type => "LEFT", >@@ -300,16 +306,22 @@ __PACKAGE__->belongs_to( > > =head2 old_checkout > >-Type: belongs_to >+Type: has_many but should be belongs_to >+ >+To get around TestBuilder failures we set this relation to has_many as it >+allows us to produce the same query without triggering TestBuilder failures >+(when it tries to create the issue twice, once for the checkout relation above >+and once for the old_checkouts). might_have would also be more appropriate, >+but this triggers a DBIC warning as the key field here is nullable. > > Related object: L<Koha::Schema::Result::OldIssue> > > =cut > >-__PACKAGE__->belongs_to( >+__PACKAGE__->has_many( > "old_checkout", > "Koha::Schema::Result::OldIssue", >- { issue_id => "issue_id" }, >+ { "foreign.issue_id" => "self.issue_id" }, > { > is_deferrable => 1, > join_type => "LEFT", >-- >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