[Bug 19675] New: Cannot save notices when setting the TranslateNotices preference
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 Bug ID: 19675 Summary: Cannot save notices when setting the TranslateNotices preference Change sponsored?: --- Product: Koha Version: 17.05 Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Notices Assignee: koha-bugs@lists.koha-community.org Reporter: andreas.jonsson@kreablo.se QA Contact: testopia@bugs.koha-community.org The lang parameter is missing in the where clause of the update statement. The below patch fixes the problem. diff --git a/tools/letter.pl b/tools/letter.pl index 5920a8437f..f89930472c 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -303,11 +303,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( To reproduce: 1. Enable TranslateNotices global preference. 2. Edit any notice message and save a translation. 3. Try updating any translation. The save will fail and the log-file will contain errors such as this: DBIx::Class::Storage::DBI::select_single(): Query returned more than one row. SQL that returns multiple rows is DEPRECATED for ->find and ->single at /usr/share/koha/lib/Koha/Objects.pm line 92 DBIx::Class::Storage::DBI::select_single(): Query returned more than one row. SQL that returns multiple rows is DEPRECATED for ->find and ->single at /usr/share/koha/lib/Koha/Objects.pm line 92 DBD::mysql::db do failed: Duplicate entry 'circulation-ODUE--email-sv-SE' for key 'PRIMARY' [for Statement " UPDATE letter SET branchcode = ?, module = ?, name = ?, is_html = ?, title = ?, content = ?, lang = ? WHERE branchcode = ? AND module = ? AND code = ? AND message_transport_type = ? "] at /usr/share/koha/intranet/cgi-bin/tools/letter.pl line 302. DBD::mysql::db do failed: Duplicate entry 'circulation-ODUE--email-en' for key 'PRIMARY' [for Statement " UPDATE letter SET branchcode = ?, module = ?, name = ?, is_html = ?, title = ?, content = ?, lang = ? WHERE branchcode = ? AND module = ? AND code = ? AND message_transport_type = ? "] at /usr/share/koha/intranet/cgi-bin/tools/letter.pl line 302. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- Could you please attach the diff as a Git patch? There are some good tips about the easiest way to do that here: https://wiki.koha-community.org/wiki/Git_bz_configuration -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|17.05 |master CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 69347 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69347&action=edit Bug 19675: Fix update notice templates when they are translatable Avoid the following error: DBD::mysql::db do failed: Duplicate entry 'acquisition-xxx--email-default' for key 'PRIMARY' [for Statement " -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |andreas.jonsson@kreablo.se |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69347|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 69348 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69348&action=edit Bug 19675: Fix update notice templates when they are translatable 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Depends on| |17762 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Skipping QA. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17762 [Bug 17762] Ability to translate notices -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Path pushed to master for 17.11, thanks Andreas and congrats for your first patch in! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 --- Comment #6 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Thanks you for pushing this so swiftly! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19675 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hagud@orex.es --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 19516 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org