Skip to content

Commit ca78e1d

Browse files
committedSep 17, 2012
Spectre is touchy about things that die in perl. Fix the UpdateAssetSubscribers workflow activity to catch if the group in the asset does not exist.
1 parent 2aeca17 commit ca78e1d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎docs/changelog/7.x.x.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- fixed #12362: Thingy default Y/N field overly default
88
- fixed #12385: UTF-8 characters in Asset title break the Trash
99
- fixed ... and the same problem in the Clipboard
10+
- fixed: UpdateAssetSubscribers workflow activity ERRORs if the group cannot be found.
1011

1112
7.10.26
1213
- fixed: Template diagnostics when called without a session asset.

‎lib/WebGUI/Workflow/Activity/UpdateAssetSubscribers.pm

+6-1
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,18 @@ See WebGUI::Workflow::Activity::execute() for details.
7171
sub execute {
7272
my $self = shift;
7373
my $asset = shift;
74+
my $session = $self->session;
7475

7576
return unless $asset->get('subscriptionGroupId');
7677

7778
my $expireTime = time() + $self->getTTL();
78-
my $subscriptionGroup = WebGUI::Group->new($self->session, $asset->get('subscriptionGroupId'));
79+
my $subscriptionGroup = WebGUI::Group->new($session, $asset->get('subscriptionGroupId'));
7980

8081
##Deserialize from scratch
82+
if (! $subscriptionGroup) {
83+
$session->log->warn("Subscription group is missing for assetId: ".$asset->getId);
84+
return $self->COMPLETE;
85+
}
8186
my @users = @{ $subscriptionGroup->getUsers }; ##Cache
8287
my @usersToDelete = (); ##Cache
8388
##Note, we could use grep here, but we can't interrupt if the workflow runs too long

0 commit comments

Comments
 (0)
Please sign in to comment.