Bugzilla – Attachment 171664 Details for
Bug 37892
Patron category 'can be a guarantee' means that same category cannot be a guarantor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37892: (follow-up) Fix patron creation
Bug-37892-follow-up-Fix-patron-creation.patch (text/plain), 1.75 KB, created by
Baptiste Wojtkowski (bwoj)
on 2024-09-18 13:50:09 UTC
(
hide
)
Description:
Bug 37892: (follow-up) Fix patron creation
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2024-09-18 13:50:09 UTC
Size:
1.75 KB
patch
obsolete
>From 1650be9819354d8f585556558d3b90994ddbc630 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Fri, 13 Sep 2024 16:53:20 +0200 >Subject: [PATCH] Bug 37892: (follow-up) Fix patron creation > >TEST PLAN: >1 - Do the 22 parts of the test plan >2 - Add a guarantor to one patron not selected before (let's say A is > the guarantee, B the guarantor) >3 - Try and add a guarantor to B -> you will success >4 - Remove B's guarantor >5 - Apply this patch >6 - Repeat 3 -> you will not be able to > >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > Koha/Patron.pm | 13 +++++++++++++ > members/memberentry.pl | 2 +- > 2 files changed, 14 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 06565b7..ea64231 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -569,6 +569,19 @@ sub guarantee_relationships { > ); > } > >+ >+=head3 is_guarantor >+ >+Returns true if the patron is a guarantor. >+ >+=cut >+ >+sub is_guarantor { >+ my ($self) = @_; >+ return $self->guarantee_relationships()->count() >+} >+ >+ > =head3 relationships_debt > > Returns the amount owed by the patron's guarantors *and* the other guarantees of those guarantors >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 9025e0d..0d09b16 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -285,7 +285,7 @@ if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) > } > > foreach my $guarantor (@guarantors) { >- if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) && ($guarantor->is_child ) || $guarantor->is_guarantee) { >+ if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) && ($guarantor->is_child ) || $guarantor->is_guarantee || $patron->is_guarantor) { > push @errors, 'ERROR_guarantor_is_guarantee'; > } > } >-- >2.43.0
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 37892
:
171334
|
171335
|
171336
|
171337
|
171451
|
171463
|
171464
|
171465
|
171466
|
171467
|
171472
|
171475
|
171476
|
171477
|
171478
|
171479
|
171480
|
171546
|
171547
|
171548
|
171549
|
171550
|
171663
|
171664
|
171665
|
171824
|
171825
|
171826
|
172896
|
172897
|
172898