Bug 19675: Fix update notice templates when they are translatable
authorAndreas Jonsson <andreas.jonsson@kreablo.se>
Sun, 26 Nov 2017 17:10:38 +0000 (14:10 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sun, 26 Nov 2017 17:13:24 +0000 (14:13 -0300)
Avoid the following error:
DBD::mysql::db do failed: Duplicate entry
'acquisition-xxx--email-default' for key 'PRIMARY' [for Statement "

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
tools/letter.pl

index d0c52c2..9222079 100755 (executable)
@@ -309,11 +309,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(