Bugzilla – Attachment 139939 Details for
Bug 31470
Incorrect selector for relationship dropdown used in members.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31470: Use class "relationship" instead of id "relationship" in members.js
0001-Bug-31470-Use-class-relationship-instead-of-id-relat.patch (text/plain), 2.42 KB, created by
Emmi Takkinen
on 2022-08-29 08:04:32 UTC
(
hide
)
Description:
Bug 31470: Use class "relationship" instead of id "relationship" in members.js
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2022-08-29 08:04:32 UTC
Size:
2.42 KB
patch
obsolete
>From 264daab31c95d74364d133eafb8eaa8b09ee69f3 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Fri, 26 Aug 2022 15:42:29 +0300 >Subject: [PATCH] Bug 31470: Use class "relationship" instead of id > "relationship" in members.js > >In members.js line 112 variable guarantor_relationship is selected with >id "relationship". Correct selector should however be class >"relationship" since id "relationship" is used in auth-finder-search.inc, >not in memberentry.pl. > >One way to see what kind of effect incorrect selector has (and how I >originally stumbled into this), is to add into "IntranetUserJS" a line >which changes non-patron guarantors relationship default selected value as >other than empty. We use script to change "relationship" instead of >"new_guarantor_relationship" because selector input for patron guarantors >relationship actually uses default selected value from non-patron guarantors >relationship. > >To test: >1. Make sure you have some value(s) in syspref "borrowerRelationship" e.g. "guarantor". >2. Add following line to "IntranetUseJS": $('.relationship option:eq(1)').attr('selected', 'selected'); >3. Add guarantee patron and note that non-patron guarantors relationship is now "guarantor". >4. Add patron guarantor and note that relationship value is empty. >5. Apply this patch and refresh page. >6. Repeat step 4. >=> Note that now relationship value is "guarantor". > >Sponsored-by: Koha-Suomi Oy >--- > koha-tmpl/intranet-tmpl/prog/js/members.js | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 597bb5d141..7b4095cbc3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -109,9 +109,9 @@ function select_user(borrowernumber, borrower, relationship) { > fieldset.find('.new_guarantor_firstname_text').first().text( guarantor_firstname ); > $('#guarantor_firstname').val(""); > >- var guarantor_relationship = $('#relationship').val(); >+ var guarantor_relationship = $('.relationship').val(); > fieldset.find('.new_guarantor_relationship').first().val( guarantor_relationship ); >- $('#relationship').find('option:eq(0)').prop('selected', true); >+ $('.relationship').find('option:eq(0)').prop('selected', true); > > fieldset.find('.guarantor-details').first().attr( 'data-borrowernumber', borrowernumber ); > >-- >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 31470
:
139826
|
139939
|
144570
|
167432
|
167433
|
167842
|
167843
|
171946
|
171947