Bugzilla – Attachment 183249 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..." pop-up when error occurs
Bug-40116-Do-not-display-Patron-is-already-a-guara.patch (text/plain), 3.35 KB, created by
David Flater
on 2025-06-13 18:36:33 UTC
(
hide
)
Description:
Bug 40116: Do not display "Patron is already a guarantor..." pop-up when error occurs
Filename:
MIME Type:
Creator:
David Flater
Created:
2025-06-13 18:36:33 UTC
Size:
3.35 KB
patch
obsolete
>From f4b82597bc3de88404f9e4e9f249415e9dab5ddd 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..." > pop-up 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. This patch >sends nok variable as parameter to this same function so that if error >occurs checkin patron guarantors is skipped. > >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 >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. > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: David Flater <flaterdavid@gmail.com> >--- > .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/members.js | 4 ++-- > 2 files changed, 3 insertions(+), 3 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 361a178107..494bf3cc37 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1779,7 +1779,7 @@ > > [% IF new_guarantors %] > [% FOREACH g IN new_guarantors %] >- select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' ); >+ select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]', [% nok | $raw %] ); > [% END %] > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index a20561cfe0..7429e21859 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -90,12 +90,12 @@ function update_category_code(category_code) { > hint.html(hint_string); > } > >-function select_user(borrowernumber, borrower, relationship) { >+function select_user(borrowernumber, borrower, relationship, nok) { > let is_guarantor = $( > `.guarantor-details[data-borrowernumber=${borrowernumber}]` > ).length; > >- if (is_guarantor) { >+ if (is_guarantor && !nok) { > alert("Patron is already a guarantor for this patron"); > } else { > $("#guarantor_id").val(borrowernumber); >-- >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