From 7dcf1c0cab5fc485243036f24bb4a0885037a7b6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sat, 16 Feb 2019 11:46:08 -0300 Subject: [PATCH] Bug 22245: Allow copy/move from and to control fields The JS conditions were wrong, we want to allow copy and move between control fields. Test plan: Create a new MARC modification template action using control fields. Confirm that you are allowed to copy/move a control field to another one --- koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js index 34578569c9..76d529b22e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js +++ b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js @@ -25,8 +25,8 @@ $(document).ready(function() { alert( MSG_MMT_CONTROL_FIELD_EMPTY ); return false; } - if ( ( $("#from_field").val() < 10 && $("#to_subfield").val().length === 0 ) || - ( $("#to_field").val() < 10 && $("#from_subfield").val().length === 0 ) ) { + if ( ( $("#from_field").val() < 10 && $("#to_field").val() >= 10 ) || + ( $("#to_field").val() < 10 && $("#from_field").val() >= 10 ) ) { alert( MSG_MMT_CONTROL_FIELD ); return false; } -- 2.11.0