From 56ec9290ab97f674b939b9cfdb7f14707ba99eb6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 Apr 2016 16:35:23 +0100 Subject: [PATCH] Bug 16217: Resync names of notices Bug 12752 has fixed a bug for installations upgrading from 3.14, but has not fixed the problem for new installations. Because of some wrong data manipulations, the names for a given letter code may diverge. In particular OVERDUE and PREDUE names of phone notices have been wrongly modify by bug 11867: they have been set to the name of the first HOLD notice. Trying to be back on our feet, this update DB entry will try to guess and set back up the correct name. To know if your install is affected by this bug, the following SQL query can help you: SELECT code, name, message_transport_type FROM letter WHERE code="PREDUE" OR code="OVERDUE"; If the names are different for the same code, something went wrong. Executing this update DB entry should fix the divergence. --- installer/data/mysql/atomicupdate/bug_16217.perl | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_16217.perl diff --git a/installer/data/mysql/atomicupdate/bug_16217.perl b/installer/data/mysql/atomicupdate/bug_16217.perl new file mode 100644 index 0000000..5e84b64 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_16217.perl @@ -0,0 +1,13 @@ +my $letters = $dbh->selectall_arrayref(q| + SELECT code, name + FROM letter + WHERE message_transport_type="email" +|, { Slice => {} }); +for my $letter ( @$letters ) { + $dbh->do(q| + UPDATE letter + SET name = ? + WHERE code = ? + AND message_transport_type <> "email" + |, undef, $letter->{name}, $letter->{code}); +} -- 2.7.0