Bugzilla – Attachment 50388 Details for
Bug 16217
Notice' names may have diverged
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16217: Resync names of notices
Bug-16217-Resync-names-of-notices.patch (text/plain), 2.33 KB, created by
Jonathan Druart
on 2016-04-19 06:48:40 UTC
(
hide
)
Description:
Bug 16217: Resync names of notices
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-04-19 06:48:40 UTC
Size:
2.33 KB
patch
obsolete
>From 121712bf058a4d44f9105f7c923f469d3c57b87f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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/updatedatabase.pl | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 422ce69..9627aec 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -12219,6 +12219,30 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > print "Upgrade to $DBversion done (Bug 15008 - Add custom HTML areas to circulation and reports home pages)\n"; > SetVersion($DBversion); > } >+ >+$DBversion = "XXX"; >+if ( CheckVersion($DBversion) ) { >+ my $letters = $dbh->selectall_arrayref(q| >+ SELECT code, name >+ FROM letter >+ WHERE message_transport_type="email" >+ |, { Slice => {} }); >+ for my $letter ( @$letters ) { >+ use Data::Dumper;warn Dumper $letter; >+ $dbh->do(q| >+ UPDATE letter >+ SET name = ? >+ WHERE code = ? >+ AND message_transport_type <> "email" >+ |, undef, $letter->{name}, $letter->{code}); >+ } >+ >+ print "Upgrade to $DBversion done (Bug 16217: Resync names of notices)\n"; >+ SetVersion($DBversion); >+} >+ >+ >+ > # DEVELOPER PROCESS, search for anything to execute in the db_update directory > # SEE bug 13068 > # if there is anything in the atomicupdate, read and execute it. >-- >2.7.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16217
:
49997
|
50388
|
50722
|
50736
|
50751
|
50877