From c4c8fbca551ae7676b46f453280713bf4d7558da 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=UTF-8 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 --- koha-tmpl/intranet-tmpl/prog/en/js/members.js | 6 +++--- koha-tmpl/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 7f7955a..2acefb6 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 d470166..9d23c44 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -213,7 +213,7 @@ function select_user(borrowernumber, borrower) { -
+ -- 2.7.0