From a1bc4e04a4d3d53529f2ae1ad7b107cc5c824224 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 20 Mar 2013 14:46:07 +0100 Subject: [PATCH] Bug 8378 - followup - update notices to use <> --- installer/data/mysql/updatedatabase.pl | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f0a9269..4b37c57 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6532,6 +6532,23 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.11.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + my $sth = $dbh->prepare(" + SELECT module, code, branchcode, content + FROM letter + WHERE content LIKE '%%' + "); + $sth->execute; + my $sth_update = $dbh->prepare("UPDATE letter SET content = ? WHERE module = ? AND code = ? AND branchcode = ?"); + while(my $row = $sth->fetchrow_hashref){ + $row->{content} =~ s/\w+<\/fine>/<>/; + $sth_update->execute($row->{content}, $row->{module}, $row->{code}, $row->{branchcode}); + } + print "Upgrade to $DBversion done (use new <> syntax in notices)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 1.7.2.5