From 7d0ca32de62da3f85eee596945dc46b41e2ee016 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 8 Dec 2005 03:14:11 +0000 Subject: [PATCH] upgrades remove cache fix post update dates add version tag to server status --- docs/changelog/6.x.x.txt | 3 +++ docs/upgrades/upgrade_6.8.0-6.8.1.pl | 7 +++++++ lib/WebGUI.pm | 1 + sbin/upgrade.pl | 15 ++++++++++----- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 6448a5124..67981c210 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -1,6 +1,7 @@ 6.8.1 - fix [ 1364965 ] Assets in Trash give Permission Denied in stead of Not Found + - fix [ 1372680 ] dashboard needs hide option - Removed duplicate processing of metadata. - fix [ 1373649 ] Username isn't populated in 6.8.0 Discussions - fix [ 1373707 ] File Pile not uploading images @@ -24,6 +25,8 @@ need to do to fix it is upgrade to this release and then run sbin/rebuildLineage.pl - fix [ 1356544 ] FAQ template in collaboration has wrong anchors + - The upgrade script now wipes out the file cache in case it would cause + any conflicts. - fix [ 1373493 ] Upgrade script fails because parameters are not quoted - Upgrade now uses --results-file parameter on mysqldump because some operating system don't handle UTF-8 characters through their pipes. diff --git a/docs/upgrades/upgrade_6.8.0-6.8.1.pl b/docs/upgrades/upgrade_6.8.0-6.8.1.pl index eb71b2689..09c3e5362 100644 --- a/docs/upgrades/upgrade_6.8.0-6.8.1.pl +++ b/docs/upgrades/upgrade_6.8.0-6.8.1.pl @@ -26,10 +26,17 @@ upgradeRichEditor(); fixCSFaqTemplateAnchors(); updateProfileSystem(); convertDashboardPrefs(); +fixPosts(); finish(); # this line required +#------------------------------------------------- +sub fixPosts { + print "\tFixing posts.\n" unless ($quiet); + WebGUI::SQL->write("update Post set dateUpdated=".time()." where dateUpdated=0"); +} + #------------------------------------------------- sub updateProfileSystem { print "\tUpdating user profile system.\n" unless ($quiet); diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index a4733d3ae..3facd9d6b 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -43,6 +43,7 @@ sub handler { my $r = shift; $session{site} = shift || $r->dir_config('WebguiConfig'); my $s = Apache2::ServerUtil->server; + $s->add_version_component("WebGUI/".$WebGUI::VERSION); $session{wguri} = $r->uri; $session{config} = WebGUI::Config::getConfig($s->dir_config('WebguiRoot'),$session{site}); ### Add Apache Request stuff to global session. Yes, I know the global hash will eventually be deprecated. diff --git a/sbin/upgrade.pl b/sbin/upgrade.pl index c10da22de..df0f10547 100644 --- a/sbin/upgrade.pl +++ b/sbin/upgrade.pl @@ -164,11 +164,16 @@ foreach my $filename (keys %{$configs}) { order by dateApplied desc, webguiVersion desc limit 1",$dbh); unless ($history) { print "\tPreparing site for upgrade.\n" unless ($quiet); - WebGUI::Session::open($webguiRoot,$filename); - WebGUI::Setting::remove('specialState'); - WebGUI::Setting::add('specialState','upgrading'); - WebGUI::Session::close(); - rmtree($configs->{$filename}{uploadsPath}.$slash."temp"); + WebGUI::Session::open($webguiRoot,$filename); + WebGUI::Setting::remove('specialState'); + WebGUI::Setting::add('specialState','upgrading'); + WebGUI::Session::close(); + print "\tDeleting temp files.\n" unless ($quiet); + my $path = $configs->{$filename}{uploadsPath}.$slash."temp"; + rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); + print "\tDeleting file cache.\n" unless ($quiet); + $path = $configs->{$filename}{fileCacheRoot}||"/tmp/WebGUICache"; + rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); } $dbh->disconnect; } else {