Bugzilla – Attachment 176500 Details for
Bug 38841
Guarantor does not check non members guarantor while deleting with ChildNeedsGuarantor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38841: Check non-patron guarantor while deleting patron guarantor
Bug-38841-Check-non-patron-guarantor-while-deletin.patch (text/plain), 2.05 KB, created by
Thibault Keromnès
on 2025-01-14 12:58:34 UTC
(
hide
)
Description:
Bug 38841: Check non-patron guarantor while deleting patron guarantor
Filename:
MIME Type:
Creator:
Thibault Keromnès
Created:
2025-01-14 12:58:34 UTC
Size:
2.05 KB
patch
obsolete
>From f52d70e35249c3408ee47b04dd1ff70cb47122d9 Mon Sep 17 00:00:00 2001 >From: Baptiste <baptiste.wojtkowski@biblibre.com> >Date: Tue, 7 Jan 2025 16:50:13 +0100 >Subject: [PATCH] Bug 38841: Check non-patron guarantor while deleting patron > guarantor > >When editing a child while Childneedsquarantor active, trying to delete >a guarantor while saving a non-patron guarantor will prevent the user >from saving. However, if an adult has expired, some librarian would like >to remove the account and let some information in non-patron guarantor. > >TEST PLAN > >Before applying patch >1 - Open Lisa Charles'page, add Henry Acevedo as Guarantor, also fill > Guarantor surname and firstname >2 - Edit the page and try and remove Henry Acevedo, it won't work > however there is still one guarantor > >3 - Apply patch >4 - Try and remove Henry Acevedo -> it will work >5 - add HA as a guarantor again >6 - try and remove him AND let guarantor firstname and surname empty -> > you can't >7 - Add HA and Edna Acosta as guarantor >8 - Remove HA and ler guarantor firstname and surname empty -> you can > >Signed-off-by: Thibault Keromnes <thibault.keromnes@univ-paris8.fr> >--- > members/memberentry.pl | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index f1fd9bfe5b..8e456f6db6 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -262,9 +262,11 @@ if ( ( $op eq 'cud-insert' ) and !$nodouble ) { > #Attempt to delete guarantors > my @delete_guarantor = $input->multi_param('delete_guarantor'); > if (@delete_guarantor) { >- if ( C4::Context->preference('ChildNeedsGuarantor') >- && scalar @guarantors - scalar @delete_guarantor == 0 ) >- { >+ my $will_remove_last = >+ ( scalar @guarantors - scalar @delete_guarantor == 0 ) >+ && $newdata{'contactname'} eq q{} >+ && $newdata{'contactfirstname'} eq q{}; >+ if ( C4::Context->preference('ChildNeedsGuarantor') && $will_remove_last ) { > push @errors, 'ERROR_cannot_delete_guarantor'; > } else { > foreach my $id (@delete_guarantor) { >-- >2.39.5
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 38841
:
176200
| 176500