Bug 18789: (QA follow-up) Fix viewlog when accessed via circulation
[koha.git] / tools / letter.pl
index d0c52c2..ef29c73 100755 (executable)
@@ -40,8 +40,7 @@
 # TODO This script drives the CRUD operations on the letter table
 # The DB interaction should be handled by calls to C4/Letters.pm
 
-use strict;
-use warnings;
+use Modern::Perl;
 use CGI qw ( -utf8 );
 use C4::Auth;
 use C4::Context;
@@ -309,11 +308,11 @@ sub add_validate {
                 q{
                     UPDATE letter
                     SET branchcode = ?, module = ?, name = ?, is_html = ?, title = ?, content = ?, lang = ?
-                    WHERE branchcode = ? AND module = ? AND code = ? AND message_transport_type = ?
+                    WHERE branchcode = ? AND module = ? AND code = ? AND message_transport_type = ? AND lang = ?
                 },
                 undef,
                 $branchcode || '', $module, $name, $is_html || 0, $title, $content, $lang,
-                $branchcode, $oldmodule, $code, $mtt
+                $branchcode, $oldmodule, $code, $mtt, $lang
             );
         } else {
             $dbh->do(