Bugzilla – Attachment 184119 Details for
Bug 40116
Extra popup notice when saving a patron with patron guarantor ends in error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40116: Do not display "Patron is already a guarantor..." popup when error occurs
Bug-40116-Do-not-display-Patron-is-already-a-guara.patch (text/plain), 4.90 KB, created by
Aleisha Amohia
on 2025-07-15 21:37:17 UTC
(
hide
)
Description:
Bug 40116: Do not display "Patron is already a guarantor..." popup when error occurs
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2025-07-15 21:37:17 UTC
Size:
4.90 KB
patch
obsolete
>From fe7e7dd5d223efcedb2662e9558271c519b7df9b Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Fri, 13 Jun 2025 13:15:57 +0300 >Subject: [PATCH] Bug 40116: Do not display "Patron is already a guarantor..." > popup when error occurs > >If a yellow error message appears when saving the guaranteed patron, >also an extra popup message "Patron is already a guarantor for this >patron" will appear on the screen. It should only appear when you try >to add the same patron as a guarantor that already is a guarantor for >that patron. This happens because js function select_user is triggered >every time when guarantor data is send back to front-end with variable >new_guarantors if error occurs. Already existing guarantors shouldn't >be send back to front-end since their data is not lost. This patch >changes existing guarantors form elements to use classes "guarantor_id" >and "guarantor_relationship" to prevent this. > >To test: >1. Find a patron with Patron guarantor or add first a Patron guarantor > (not a Non-patron guarantor) to a juvenile patron and save. >2. Edit again the same patron with guarantor and modify their age > to be greater than the upperage or under the required age of the > patron category. > => Notice that you will get a yellow message "The following fields > are wrong. Please fix them..." > => Notice that you will also get a pop up notice that says "Patron is > already a guarantor for this patron". >3. Apply this patch. >4. Repeat step 2. > => Confirm that yellow message box is displayed but "Patron is..." > pop-up is not > => Also confirm that guarantors data is not lost. >5. Try to add same patron guarantor as guarantor for guarantee patron > again. > => Confirm that pop-up is displayed right after attempting to add > guarantor. >6. Try to add new guarantor for patron. > => New guarantor should be added. >7. Attempt to save the patron. > => Confirm that both guarantors data is still displayed in form. >8. Fix patrons age and attempt to save. > => Patron is saved and both guarantors are displayed in their > details. > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> >--- > .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 4 ++-- > members/memberentry.pl | 3 +++ > 2 files changed, 5 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 361a178107c..4f86e49e182 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -489,12 +489,12 @@ > <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]"> > <span class="label">Guarantor:</span> > [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %] >- <input type="hidden" class="new_guarantor_id relation-[% r.id | html %]" name="new_guarantor_id" value="[% r.guarantor_id | html %]" /> >+ <input type="hidden" class="guarantor_id relation-[% r.id | html %]" name="guarantor_id" value="[% r.guarantor_id | html %]" /> > </li> > <li> > <span class="label">Relationship:</span> > <span>[% r.relationship | html %]</span> >- <input type="hidden" class="new_guarantor_relationship relation-[% r.id | html %]" name="new_guarantor_relationship" value="[% r.relationship | html %]" /> >+ <input type="hidden" class="guarantor_relationship relation-[% r.id | html %]" name="guarantor_relationship" value="[% r.relationship | html %]" /> > </li> > > <li> >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 59bffba29e5..6b39df29969 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -560,6 +560,9 @@ if ( ( !$nok ) and $nodouble and ( $op eq 'cud-insert' or $op eq 'cud-save' ) ) > > delete $newdata{password2}; > >+ delete $newdata{guarantor_id}; >+ delete $newdata{guarantor_relationship}; >+ > try { > $patron->set( \%newdata )->store( { guarantors => \@guarantors } ) if scalar( keys %newdata ) > 1; > >-- >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 40116
:
183240
|
183249
|
183718
|
183746
|
183780
|
184049
| 184119