[vhffs-dev] [438] Added a compatibility script to fix object descriptions containing \ |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 438
Author: beuss
Date: 2007-02-04 11:59:46 +0000 (Sun, 04 Feb 2007)
Log Message:
-----------
Added a compatibility script to fix object descriptions containing \
Added Paths:
-----------
branches/vhffs_4.1/vhffs-compat/
branches/vhffs_4.1/vhffs-compat/fix_desc.pl
Added: branches/vhffs_4.1/vhffs-compat/fix_desc.pl
===================================================================
--- branches/vhffs_4.1/vhffs-compat/fix_desc.pl 2007-02-04 11:24:07 UTC (rev 437)
+++ branches/vhffs_4.1/vhffs-compat/fix_desc.pl 2007-02-04 11:59:46 UTC (rev 438)
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+
+use lib "/usr/share/vhffs/api";
+use Vhffs::Main;
+
+my $vhffs = init Vhffs::Main;
+my $dbh = $vhffs->get_db_object();
+
+my $sql = 'SELECT object_id, description FROM vhffs_object';
+my $rows = $dbh->selectall_arrayref($sql);
+
+my $sth = $dbh->prepare('UPDATE vhffs_object SET description = ? WHERE object_id = ?');
+foreach(@{$rows}) {
+ $sth->execute($_->[1], $_->[0]) or warn "Unable to update object #$_->[0] (description $_->[1])";
+}