Skip to content

Commit

Permalink
Spectre is touchy about things that die in perl. Fix the UpdateAssetS…
Browse files Browse the repository at this point in the history
…ubscribers workflow activity to catch if the group in the asset does not exist.
  • Loading branch information
perlDreamer committed Sep 17, 2012
1 parent 2aeca17 commit ca78e1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog/7.x.x.txt
Expand Up @@ -7,6 +7,7 @@
- fixed #12362: Thingy default Y/N field overly default
- fixed #12385: UTF-8 characters in Asset title break the Trash
- fixed ... and the same problem in the Clipboard
- fixed: UpdateAssetSubscribers workflow activity ERRORs if the group cannot be found.

7.10.26
- fixed: Template diagnostics when called without a session asset.
Expand Down
7 changes: 6 additions & 1 deletion lib/WebGUI/Workflow/Activity/UpdateAssetSubscribers.pm
Expand Up @@ -71,13 +71,18 @@ See WebGUI::Workflow::Activity::execute() for details.
sub execute {
my $self = shift;
my $asset = shift;
my $session = $self->session;

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

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

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

0 comments on commit ca78e1d

Please sign in to comment.