From 3755a38acfd4972d794bef8cb844e5474c3c4112 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Feb 2018 18:40:36 -0300 Subject: [PATCH] Bug 20144: [sql_modes] Set default value for marc_modification_template_actions Cannot be empty strings. Fix for: Data truncated for column 'conditional' Data truncated for column 'conditional_comparison' Incorrect integer value: '' for column 'conditional_regex' t/db_dependent/MarcModificationTemplates.t Signed-off-by: Josef Moravec Signed-off-by: Julian Maurice Signed-off-by: Jonathan Druart --- C4/MarcModificationTemplates.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm index bbfb1c6470..3932e806b4 100644 --- a/C4/MarcModificationTemplates.pm +++ b/C4/MarcModificationTemplates.pm @@ -240,6 +240,8 @@ sub AddModificationTemplateAction { $to_regex_search, $to_regex_replace, $to_regex_modifiers, $conditional, $conditional_field, $conditional_subfield, $conditional_comparison, $conditional_value, $conditional_regex, $description )" ) if DEBUG; + $conditional ||= undef; + $conditional_comparison ||= undef; $conditional_regex ||= '0'; my $dbh = C4::Context->dbh; @@ -337,6 +339,9 @@ sub ModModificationTemplateAction { ) = @_; my $dbh = C4::Context->dbh; + $conditional ||= undef; + $conditional_comparison ||= undef; + $conditional_regex ||= '0'; my $query = " UPDATE marc_modification_template_actions SET -- 2.39.5