Bugzilla – Attachment 171663 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.64 KB, created by
Baptiste Wojtkowski (bwoj)
on 2024-09-18 13:50:07 UTC
(
hide
)
Description:
Bug 37892: (follow-up) Fix patron creation
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2024-09-18 13:50:07 UTC
Size:
1.64 KB
patch
obsolete
>From 12634eb4bbe0da6d8afe93d45e8b8e229984160e Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Fri, 13 Sep 2024 13:56:42 +0200 >Subject: [PATCH] Bug 37892: (follow-up) Fix patron creation > >This patch fixes the 22. of the test plan (22 - Confirm you cannot add a guarantor - "Guarantor cannot be a guarantee" > ) > >Signed-off-by: Olivier V <olivier.vezina@inLibro.com> >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > Koha/Patron.pm | 12 ++++++++++++ > members/memberentry.pl | 2 +- > 2 files changed, 13 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index ab20e8c..06565b7 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -533,6 +533,18 @@ sub guarantor_relationships { > return Koha::Patron::Relationships->search( { guarantee_id => $self->id } ); > } > >+=head3 is_guarantee >+ >+Returns true if the patron has a guarantor. >+ >+=cut >+ >+sub is_guarantee { >+ my ($self) = @_; >+ return $self->guarantor_relationships()->count() >+} >+ >+ > =head3 guarantee_relationships > > Returns Koha::Patron::Relationships object for this patron's guarantors >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 23aef6a..9025e0d 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 ) { >+ if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) && ($guarantor->is_child ) || $guarantor->is_guarantee) { > 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