Bugzilla – Attachment 183746 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: Change classes for existing guarantors in patron form
0001-Bug-40116-Change-classes-for-existing-guarantors-in-.patch (text/plain), 4.22 KB, created by
Emmi Takkinen
on 2025-07-03 11:11:16 UTC
(
hide
)
Description:
Bug 40116: Change classes for existing guarantors in patron form
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2025-07-03 11:11:16 UTC
Size:
4.22 KB
patch
obsolete
>From 316c46927b763c25503be880929c3ddd89d080b7 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Thu, 3 Jul 2025 13:00:58 +0300 >Subject: [PATCH] Bug 40116: Change classes for existing guarantors in patron > form > >We are currently using classes "new_guarantor_id" and >"new_guarantor_relationship" with existing guarantors in patron >add/modify form. These classes should mainly be used when >new guarantor is added and to ensure their data is not lost when >error occurs. Now with previous patch applied using them leads to >situation where existing guarantors information is displayed twice >(or more times) if error occurs. This patch changes these classes >as "guarantor_id" and "guarantor_relationship". > >To test: >1. Find patron who has a guarantor. >2. Modify their age to be greater than the upperage or under the >required age of the patron category. >3. Attempt to save patron. >=> Notice that guarantor is now displayed twice in "Patron guarantor" >section. >4. Apply this patch. >5. Attempt to save the patron again. >=> Notice that guarantor is no longer duplicated in >"Patron guarantor" section. >6. Try to readd same patron as guarantor. >=> Pop-up "Patron is already a guarantor for this patron" should be >displayed. >7. Try to add new guarantor for patron. >=> New guarantor should be added. >8. Attempt to save the patron. >=> Neither existing patron or new patron is duplicated. >9. Fix patrons age and attempt to save. >=> Patron is saved and both guarantors are displayed in their details. > >Sponsored-by: Koha-Suomi Oy >--- > .../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 494bf3cc37..ed4c99f313 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 59bffba29e..6b39df2996 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.34.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 40116
:
183240
|
183249
|
183718
|
183746
|
183780
|
184049
|
184119