From f3aa919c502134f02f19894079a6f2e35de17bea Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 11 May 2012 16:40:11 +0200 Subject: [PATCH] Bug 7178 follow-up: Fix check_additem when UniqueItemFields is empty Signed-off-by: Paul Poulain --- koha-tmpl/intranet-tmpl/prog/en/js/additem.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js b/koha-tmpl/intranet-tmpl/prog/en/js/additem.js index 2d72de7f41..f892ca8c89 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/additem.js @@ -182,8 +182,11 @@ function check_additem(unique_item_fields) { // Check if a value is duplicated in form for ( field in array_fields ) { var fieldname = array_fields[field]; + if (fieldname == '') { + continue; + } var values = new Array(); - $("[name='kohafield'][value=items."+array_fields[field]+"]").each(function(){ + $("[name='kohafield'][value=items."+ fieldname +"]").each(function(){ var input = $(this).prevAll("input[name='field_value']")[0]; if($(input).val()) { values.push($(input).val()); -- 2.39.5