From 42b2461f052d9902a6fcc2201dcae78e78604c19 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 21 Jun 2017 16:53:56 +0200 Subject: [PATCH] Bug 18834: Remove js function Check from opac-shelves Content-Type: text/plain; charset=utf-8 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. --- .../opac-tmpl/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 c267248..3997490 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -550,7 +550,7 @@
  1. -
  2. + Required
  3. + [% IF referer == 'view' %] Cancel [% ELSE %] @@ -937,24 +937,6 @@ $(function() { [% END %] }); // 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 AdjustPerms() { var category = $("#category").val(); var count_perms = $("#allow_changes_from option").length; -- 2.1.4