From efc4caec968dd0394c6d1ee8a2c4be66cc697afb Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 21 Jun 2017 16:53:56 +0200 Subject: [PATCH] Bug 18980: Remove js function Check from opac-shelves MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This function only serves to check if the shelf name is not empty. It does not even work since it incorrectly refers to f.addshelf (while it should test #shelfname). We can solve this and improve consistency by doing the same as in the staff template with html5 required. Test plan: [1] Without this patch it was possible to add a list without a name in OPAC (with js error: TypeError: f.addshelf is undefined). [2] With this patch, verify that you cannot do this anymore. Signed-off-by: Marcel de Rooy Signed-off-by: Lee Jamison Signed-off-by: Marc Véron Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- .../bootstrap/en/modules/opac-shelves.tt | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index 0417531f12..f662c88ff1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -549,7 +549,7 @@
  1. -
  2. + Required
  3. + [% IF referer == 'view' %] Cancel [% ELSE %] @@ -938,24 +938,6 @@ $(function() { AdjustRemark(); }); // document.ready -function Check(f) { - var _alertString=""; - var alertString2; - - if(f.addshelf.value.length ==0){ - _alertString += _("- You must enter a list name") + "\n"; - } - - if (_alertString.length==0) { - f.submit(); - } else { - alertString2 = _("Form not submitted because of the following problem(s)"); - alertString2 += "\n------------------------------------------------------------------------------------\n\n"; - alertString2 += _alertString; - alert(alertString2); - } -} - function AdjustRemark() { var category; if( $("#category").length > 0 ) { -- 2.39.5