From 101ba17685513364f80ec574cabd144d81570ddc Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 14 Mar 2016 11:36:19 -0400 Subject: [PATCH] Bug 16066 - JavaScript error on new patron form when duplicate is suspected MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When a new patron is submitted which is suspected to be a duplicate, the entry form is redisplayed with a new name attribute, "form_nodouble." Other scripts on the page still look for a form named "form," so there is an error. This patch removes the use of "form_nodouble" on the assumption that it is unnecessary to name the form something different when a duplicate is suspected. All the same validation scripts should be run on the form either way. To test, apply the patch and clear your cache if necessary. - Go to Patrons -> New patron and add a patron which matches an existing one in order to trigger the duplicate warning. - Confirm that Firebug (or similar) is not reporting a JavaScript error. - Confirm that the 'Edit existing' and 'Save as new' buttons work correctly. Reproduced JavaScript error and verified that it no longer appears with this patch. Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- koha-tmpl/intranet-tmpl/prog/en/js/members.js | 6 +++--- .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/members.js b/koha-tmpl/intranet-tmpl/prog/en/js/members.js index 7f7955af1d..2acefb60f5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/members.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/members.js @@ -95,8 +95,8 @@ function check_form_borrowers(nav){ var message_champ=""; if (document.form.check_member.value == 1 ) { - if (document.form_double.answernodouble) { - if( (!(document.form_double.answernodouble.checked))){ + if (document.form.answernodouble) { + if( (!(document.form.answernodouble.checked))){ document.form.nodouble.value=0; } else { document.form.nodouble.value=1; @@ -119,7 +119,7 @@ function check_form_borrowers(nav){ //patrons form to test if you checked no to the question of double if (statut!=1 && document.form.check_member.value > 0 ) { - if (!(document.form_double.answernodouble.checked)){ + if (!(document.form.answernodouble.checked)){ message_champ+= MSG_DUPLICATE_SUSPICION; statut=1; document.form.nodouble.value=0; 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 3a8f7c345d..05153a9353 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -214,7 +214,7 @@ function select_user(borrowernumber, borrower) { Edit existing record -
+ -- 2.39.5