Forward port removing workflow instances that don't have an underlying workflow anymore.

This commit is contained in:
Colin Kuskie 2009-01-29 17:40:43 +00:00
parent fb3c85fdd2
commit 70b0c262f5
2 changed files with 15 additions and 0 deletions

View file

@ -21,6 +21,7 @@
- fixed: utf8 issues with Survey should be correct. JSON fields are now longText instead of longBlob.
- fixed #9522: Time tracker does not display
- fixed #9215: Survey 2.0 results screens missing
- fixed #9018: orphan workflows from upgrade.
7.6.9
- fixed: ukplayer example is now loaded with swfobject.js released under the MIT licence, see gotcha's and /extras/ukplayer

View file

@ -31,6 +31,7 @@ my $quiet; # this line required
my $session = start(); # this line required
hideGalleryAlbums($session);
removeBrokenWorkflowInstances($session);
# upgrade functions go here
@ -58,6 +59,19 @@ sub hideGalleryAlbums {
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub removeBrokenWorkflowInstances {
my $session = shift;
print "\tRemove Workflow Instances whose Workflows have been deleted... " unless $quiet;
# and here's our code
my $instances = WebGUI::Workflow::Instance->getAllInstances($session);
foreach my $instance (@{ $instances }) {
my $workflow = $instance->getWorkflow;
$instance->delete('skipNotify') if !defined $workflow;
}
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------