Bug 19516 - Can't save changes on notices if letter is already created
Summary: Can't save changes on notices if letter is already created
Status: RESOLVED DUPLICATE of bug 19675
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: 17.05
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-23 12:59 UTC by Hugo Agud
Modified: 2017-12-05 10:29 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Fix condition when updating an existing letter with language support turned on (836 bytes, patch)
2017-11-10 13:58 UTC, Stefan Berndtsson
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Hugo Agud 2017-10-23 12:59:05 UTC
we have seen a problem modifying notices in koha 17.05.04, the issue is that you can not modify notices if they're already created, when you try to modify you get an error in plack as these one.

DBD::mysql::db do failed: Duplicate entry 'circulation-PREDUE--email-ca-ES' 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-PREDUE--sms-ca-ES' 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-PREDUE--email-es-ES' 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-PREDUE--sms-es-ES' 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-PREDUE--email-default' 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-PREDUE--sms-default' 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.
Comment 1 Stefan Berndtsson 2017-11-10 13:58:17 UTC
Created attachment 69086 [details] [review]
Fix condition when updating an existing letter with language support turned on

There is a missing condition for "lang" in the UPDATE line in letter.pl.
Comment 2 Katrin Fischer 2017-12-05 06:59:13 UTC
Hi Hugo and Stefan, 
could this be a duplicate to bug 19675? 
Don't forget to change status to 'needs sign-off' after posting a patch!
Comment 3 Stefan Berndtsson 2017-12-05 09:44:59 UTC
(In reply to Katrin Fischer from comment #2)
> Hi Hugo and Stefan, 
> could this be a duplicate to bug 19675? 
> Don't forget to change status to 'needs sign-off' after posting a patch!

Yes, 19675 is the same fix. It will solve the problem.
Comment 4 Katrin Fischer 2017-12-05 10:29:03 UTC

*** This bug has been marked as a duplicate of bug 19675 ***