Bugzilla – Attachment 160662 Details for
Bug 35725
Generic master form does not keep patron and cardnumber when changing type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35725: Fix 'Create' button enabled/disabled
Bug-35725-Fix-Create-button-enableddisabled.patch (text/plain), 2.36 KB, created by
David Nind
on 2024-01-08 21:27:24 UTC
(
hide
)
Description:
Bug 35725: Fix 'Create' button enabled/disabled
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-01-08 21:27:24 UTC
Size:
2.36 KB
patch
obsolete
>From 6153c217419e0e6c3634d302874c484f390f0082 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 8 Jan 2024 16:56:06 +0000 >Subject: [PATCH] Bug 35725: Fix 'Create' button enabled/disabled > >The previous patch fixed what it stated, but uncovered a new issue: >If you input a cardnumber + a branchcode and then change type, the 'Create' button becomes disabled >This happens because the trigger for it is on change only, the current patch updates this to also happen >on DOMContentLoaded. > >Test plan: >1) Apply previous patch >2) Do steps from previous patch plan up to and including step 5) >3) Click 'Create'. Notice it doesn't submit (nothing happens). >4) Apply this patch and do a hard reload (clearing browser js cache) >5) Repeat steps 1) to 3). Notice it now submits correctly. > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/ILL/Backend/intra-includes/create.inc | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > >diff --git a/Koha/ILL/Backend/intra-includes/create.inc b/Koha/ILL/Backend/intra-includes/create.inc >index 764013e1b9..2ebcc17b25 100644 >--- a/Koha/ILL/Backend/intra-includes/create.inc >+++ b/Koha/ILL/Backend/intra-includes/create.inc >@@ -119,12 +119,18 @@ > [% INCLUDE "${cwd}/shared-includes/shared.js" %] > // Require a username and branch selection > document.addEventListener('DOMContentLoaded', function(){ >- $('#create_form #cardnumber, #create_form #branchcode').change(function() { >- var comp = ['#cardnumber','#branchcode'].filter(function(id) { >- return $(id).val().length > 0; >- }); >- $('#ill-submit').attr('disabled', comp.length < 2); >+ let cardnumber_input = '#create_form #cardnumber'; >+ let branchcode_input = '#create_form #branchcode'; >+ updateCreateButtonStatus(); >+ $(cardnumber_input + ',' + branchcode_input).change(function() { >+ updateCreateButtonStatus(); >+ }); >+ function updateCreateButtonStatus(){ >+ var comp = [cardnumber_input,branchcode_input].filter(function(id) { >+ return $(id).val().length > 0; > }); >+ $('#ill-submit').attr('disabled', comp.length < 2); >+ } > /* Maintain patron autocomplete compatibility across versions */ > [% IF koha_version.major <= 22 && koha_version.minor < 11 %] > $('#create_form #cardnumber').autocomplete({ >-- >2.30.2
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 35725
:
160629
|
160630
|
160650
|
160661
|
160662
|
172738
|
172739