From b38167d415474591f8dd1de4d7ca5c059aa3ee8a Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 12 May 2006 18:30:26 +0000 Subject: [PATCH] some upgrade bug fixes --- docs/gotcha.txt | 7 +++++ docs/upgrades/upgrade_6.8.9-6.99.0.pl | 40 ++++++++++++++------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 61630470c..aedc68bfc 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -9,10 +9,17 @@ save you many hours of grief. 6.99.0 -------------------------------------------------------------------- + * The 6.99 series is the last round of changes before 7.0.0 is released. It will serve as the beta, gamma, and release candidates for 7.0.0. + * The "messageLog" table will be deleted during the upgrade process, + and all of the messages in it. This is because the messages + contained in there are no longer useful because they won't + work with the new workflow system. If you need the data in + that table, you should save it before performing the upgrade. + * The session system has been replaced by a new object-oriented one, which has caused massive API changes. Please consult migration.txt to bring your custom code up to date with the diff --git a/docs/upgrades/upgrade_6.8.9-6.99.0.pl b/docs/upgrades/upgrade_6.8.9-6.99.0.pl index dad9f1f2c..0a4c5e607 100644 --- a/docs/upgrades/upgrade_6.8.9-6.99.0.pl +++ b/docs/upgrades/upgrade_6.8.9-6.99.0.pl @@ -241,25 +241,26 @@ sub convertMessageLogToInbox { message mediumtext )"); $session->db->write("alter table Matrix_listing add column approvalMessageId varchar(22) binary"); - my $prepared = $session->db->prepare("insert into inbox (messageId, status, dateStamp, completedOn, completedBy, userId, subject, message) - values ( ?,?,?,?,?,?,?,? )"); - my $rs = $session->db->read("select * from messageLog"); - while (my $data = $rs->hashRef) { - $prepared->execute([ - $session->id->generate, - 'completed', - $data->{dateOfEntry}, - time(), - '3', - $data->{userId}, - $data->{subject}, - $data->{message} - ]); - } +# not migrating cuz it's not useful, but leaving this code here in case someone decides they need the data migrated +# my $prepared = $session->db->prepare("insert into inbox (messageId, status, dateStamp, completedOn, completedBy, userId, subject, message) +# values ( ?,?,?,?,?,?,?,? )"); +# my $rs = $session->db->read("select * from messageLog"); +# while (my $data = $rs->hashRef) { +# $prepared->execute([ +# $session->id->generate, +# 'completed', +# $data->{dateOfEntry}, +# time(), +# '3', +# $data->{userId}, +# $data->{subject} || "No Subject", +# $data->{message} +# ]); +# } $session->db->write("delete from userProfileField where fieldname='INBOXNotifications'"); $session->db->write("delete from userProfileData where fieldname='INBOXNotifications'"); $session->db->write("drop table if exists messageLog"); - $rs = $session->db->read("select distinct assetId from template where namespace='Operation/MessageLog/View' or namespace='Operation/MessageLog/Message'"); + my $rs = $session->db->read("select distinct assetId from template where namespace='Operation/MessageLog/View' or namespace='Operation/MessageLog/Message'"); while (my ($id) = $rs->array) { my $asset = WebGUI::Asset->new($session, $id, "WebGUI::Asset::Template"); if (defined $asset) { @@ -407,7 +408,7 @@ sub addWorkflow { my $rs = $session->db->read("select assetId from assetData where status='denied'"); while (my ($id) = $rs->array) { my $asset = WebGUI::Asset->newByDynamicClass($session, $id); - if ($asset->get("status") eq "denied") { + if (defined $asset && $asset->get("status") eq "denied") { $asset->purge; } } @@ -933,12 +934,13 @@ sub addSearchEngine { my $deleteWobject = $session->db->prepare("delete from wobject where assetId=?"); my $deleteAssetData = $session->db->prepare("delete from assetData where assetId=?"); foreach my $id (@searchIds) { - $deleteWobject->execute($id); - $deleteAssetData->execute($id); + $deleteWobject->execute([$id]); + $deleteAssetData->execute([$id]); } $deleteWobject->finish; $deleteAssetData->finish; $session->config->deleteFromArray("assets","WebGUI::Asset::Wobject::IndexedSearch"); + $session->config->addToArray("assets","WebGUI::Asset::Wobject::Search"); $session->db->write("drop table if exists IndexedSearch"); $session->db->write("drop table if exists IndexedSearch_default"); $session->db->write("drop table if exists IndexedSearch_default_data");