@@ -, +, @@ --- Koha/SimpleMARC.pm | 2 +- .../modules/tools/marc_modification_templates.tt | 12 ++++++++---- t/db_dependent/MarcModificationTemplates.t | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) --- a/Koha/SimpleMARC.pm +++ a/Koha/SimpleMARC.pm @@ -239,7 +239,7 @@ sub field_equals { if ( $regex ) { C4::Koha::Log( "Testing '$field_value' =~ m$value" ) if $debug >= 3; - return eval "\$field_value =~ m$value"; + return $field_value =~ m/$value/; } else { return $field_value eq $value; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt @@ -9,6 +9,8 @@ $(document).ready(function() { $('#select_template').change(function() { $('#select_template').submit(); }); + $("span.match_regex_prefix" ).hide(); + $("span.match_regex_suffix" ).hide(); }); //]]> @@ -97,9 +99,11 @@ function onToFieldRegexChange( checkboxObj ) { function onConditionalRegexChange( checkboxObj ) { if ( checkboxObj.checked ) { - document.getElementById( 'match_regex_prefix' ).style.visibility='visible'; + $("span.match_regex_prefix" ).show(); + $("span.match_regex_suffix" ).show(); } else { - document.getElementById( 'match_regex_prefix' ).style.visibility='hidden'; + $("span.match_regex_prefix" ).hide(); + $("span.match_regex_suffix" ).hide(); } } @@ -346,7 +350,7 @@ function setSelectByValue( selectId, value ) { [% IF ( ActionsLoo.conditional_comparison_equals ) %] matches [% END %] [% IF ( ActionsLoo.conditional_comparison_not_equals ) %] does not match [% END %] - [% IF ( ActionsLoo.conditional_regex ) %] RegEx m[% END %][% ActionsLoo.conditional_value %] + [% IF ( ActionsLoo.conditional_regex ) %] RegEx m/[% END %][% ActionsLoo.conditional_value %]/ [% END %] [% ActionsLoo.description %] @@ -438,7 +442,7 @@ function setSelectByValue( selectId, value ) {