diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 5d3e41d49..8bfff5419 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,5 +1,6 @@ 7.0.5 - + - Added a --skipDelete option to upgrade.pl + - rfe: Approvers don't need to approve own changes 7.0.4 diff --git a/lib/WebGUI/Workflow/Activity/ArchiveOldThreads.pm b/lib/WebGUI/Workflow/Activity/ArchiveOldThreads.pm index 55f21ca92..1c40794b8 100644 --- a/lib/WebGUI/Workflow/Activity/ArchiveOldThreads.pm +++ b/lib/WebGUI/Workflow/Activity/ArchiveOldThreads.pm @@ -73,6 +73,7 @@ sub execute { my $a = $self->session->db->read("select assetId from asset where className='WebGUI::Asset::Wobject::Collaboration'"); while (my ($assetId) = $a->array) { my $cs = WebGUI::Asset->new($self->session, $assetId, "WebGUI::Asset::Wobject::Collaboration"); + next unless defined $cs; my $archiveDate = $epoch - $cs->get("archiveAfter"); my $sql = "select asset.assetId, assetData.revisionDate from Post left join asset on asset.assetId=Post.assetId left join assetData on Post.assetId=assetData.assetId and Post.revisionDate=assetData.revisionDate diff --git a/lib/WebGUI/Workflow/Activity/RequestApprovalForVersionTag.pm b/lib/WebGUI/Workflow/Activity/RequestApprovalForVersionTag.pm index 04c7364eb..1da1e911d 100644 --- a/lib/WebGUI/Workflow/Activity/RequestApprovalForVersionTag.pm +++ b/lib/WebGUI/Workflow/Activity/RequestApprovalForVersionTag.pm @@ -20,6 +20,7 @@ use base 'WebGUI::Workflow::Activity'; use WebGUI::VersionTag; use WebGUI::Inbox; use WebGUI::International; +use WebGUI::User; =head1 NAME @@ -94,17 +95,22 @@ sub execute { my $i18n = WebGUI::International->new($self->session, "VersionTag"); my $inbox = WebGUI::Inbox->new($self->session); if ($instance->getScratch("status") eq "") { - my $message = $inbox->addMessage({ - subject=>$i18n->get("approve/deny").": ".$versionTag->get("name"), - message=>join("\n\n",$self->get("message"), - $self->session->url->getSiteURL().$self->session->url->page("op=manageRevisionsInTag;workflowInstanceId=".$instance->getId.";tagId=".$versionTag->getId), - $versionTag->get("comments")), - groupId=>$self->get("groupToApprove"), - status=>'pending' - }); - $instance->setScratch("messageId",$message->getId); - $instance->setScratch("status","notified"); - return $self->WAITING; + my $u = WebGUI::User->new($self->session, $versionTag->get("committedBy")); + if ($u->isInGroup($self->get("groupToApprove"))) { + return $self->COMPLETE; + } else { + my $message = $inbox->addMessage({ + subject=>$i18n->get("approve/deny").": ".$versionTag->get("name"), + message=>join("\n\n",$self->get("message"), + $self->session->url->getSiteURL().$self->session->url->page("op=manageRevisionsInTag;workflowInstanceId=".$instance->getId.";tagId=".$versionTag->getId), + $versionTag->get("comments")), + groupId=>$self->get("groupToApprove"), + status=>'pending' + }); + $instance->setScratch("status","notified"); + $instance->setScratch("messageId",$message->getId); + return $self->WAITING; + } } elsif ($instance->getScratch("status") eq "denied") { my $message = $inbox->getMessage($instance->getScratch("messageId")); $message->setCompleted; diff --git a/sbin/upgrade.pl b/sbin/upgrade.pl index be8448994..1f43dce99 100644 --- a/sbin/upgrade.pl +++ b/sbin/upgrade.pl @@ -33,6 +33,7 @@ my $mysql = "mysql"; my $mysqldump = "mysqldump"; my $backupDir = "/tmp/backups"; my $skipBackup; +my $skipDelete; my $doit; GetOptions( @@ -42,6 +43,7 @@ GetOptions( 'quiet'=>\$quiet, 'mysql=s'=>\$mysql, 'doit'=>\$doit, + 'skipDelete' =>\$skipDelete, 'mysqldump=s'=>\$mysqldump, 'backupDir=s'=>\$backupDir, 'skipbackup'=>\$skipBackup @@ -87,6 +89,13 @@ Options: --skipBackup Backups will not be performed during the upgrade. + --skipDelete The upgrade normally deletes WebGUI's cache + and temporary files as part of the upgrade. + This is mainly important during big upgrades, + but can make the upgrade go very slowly. + Using this option skips the deletion of these + files. + STOP exit; } @@ -183,12 +192,14 @@ foreach my $filename (keys %{$configs}) { print "\tPreparing site for upgrade.\n" unless ($quiet); $session->setting->remove('specialState'); $session->setting->add('specialState','upgrading'); - print "\tDeleting temp files.\n" unless ($quiet); - my $path = $configs->{$filename}->get("uploadsPath").$slash."temp"; - rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); - print "\tDeleting file cache.\n" unless ($quiet); - $path = $configs->{$filename}->get("fileCacheRoot")||"/tmp/WebGUICache"; - rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); + unless ($skipDelete) { + print "\tDeleting temp files.\n" unless ($quiet); + my $path = $configs->{$filename}->get("uploadsPath").$slash."temp"; + rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); + print "\tDeleting file cache.\n" unless ($quiet); + $path = $configs->{$filename}->get("fileCacheRoot")||"/tmp/WebGUICache"; + rmtree($path) unless ($path eq "" || $path eq "/" || $path eq "/data"); + } } $session->close(); } else {