From 5a59a0a9c6a8ab864341b4a515042181e5ac4ea4 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 <> Didn't break on well-formed notices, and fixed those with problems Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart Signed-off-by: Jared Camins-Esakov Conflicts: installer/data/mysql/updatedatabase.pl Signed-off-by: Chris Cormack --- installer/data/mysql/updatedatabase.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 86d97614e8..be520f34c0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5338,6 +5338,23 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion ($DBversion); } +$DBversion = '3.10.04.002'; +if ( CheckVersion($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) -- 2.39.5