Bugzilla – Attachment 126681 Details for
Bug 29303
Quick add form duplicates HTML ID's
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29303: Give quick add form fields new ID and for attributes
Bug-29303-Give-quick-add-form-fields-new-ID-and-fo.patch (text/plain), 2.75 KB, created by
Lucas Gass (lukeg)
on 2021-10-21 20:18:05 UTC
(
hide
)
Description:
Bug 29303: Give quick add form fields new ID and for attributes
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-10-21 20:18:05 UTC
Size:
2.75 KB
patch
obsolete
>From eed1403a732b4de6656f3f4caef2718ed2f9d0fe Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 21 Oct 2021 20:13:37 +0000 >Subject: [PATCH] Bug 29303: Give quick add form fields new ID and for > attributes > >To test: >1.Go to the quick add patron form >2. Use the browser dev tools to notice that there are duplicate ID's for every input on the qa form. One is showing and one is hidden. >3. These duplicate ID's won't show up in the page source because they are added with JS. >4. Apply patch >5. Try step 2 again, the quick add form fields should have an ID starting with 'qa_'. The labels 'for' attribute should aslo have this. >6. Make sure the patron quick add form still works. >7. Add several new fields to the patron qa form and make sure everything is right. >--- > .../prog/en/modules/members/memberentrygen.tt | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 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 204c59723e..1c15039ba1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1806,10 +1806,18 @@ legend:hover { > input_label='title'; > } > if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){ >- $(this).parent().clone().appendTo("#quick_add_list"); >- [% UNLESS mandatorypassword %] >- if( input_label == 'password' ) $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list"); >- [% END %] >+ var this_id = $(this).siblings().attr('id'); >+ if ( this_id ) { >+ $(this).attr('for' , 'qa_' + this_id).parent().clone().appendTo("#quick_add_list").children().attr('id' , 'qa_' + this_id); >+ [% UNLESS mandatorypassword %] >+ if( input_label == 'password' ) $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list").attr('id' , 'qa_' + this_id); >+ [% END %] >+ } else { >+ $(this).parent().clone().appendTo("#quick_add_list"); >+ [% UNLESS mandatorypassword %] >+ if( input_label == 'password' ) $("#entryform label[for='password2']").parent().clone().appendTo("quick_add_list"); >+ [% END %] >+ } > } > }); > if ( $("#memberentry_guarantor").length ) { >-- >2.20.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 29303
: 126681 |
127436