Make subscribable asset handle its built-in group correctly. Fixes bug#11004

This commit is contained in:
Colin Kuskie 2009-09-18 09:25:30 -07:00
parent b91a1effa8
commit 56f68bf291
3 changed files with 59 additions and 1 deletions

View file

@ -62,6 +62,23 @@ sub definition {
#----------------------------------------------------------------------------
=head2 duplicate ( [ options ] )
Subclass the method to create a new group for subscribers for the new asset.
=cut
sub duplicate {
my $self = shift;
my $properties = shift;
my $newSelf = $self->next::method( $properties );
$newSelf->update({ subscriptionGroupId => '' });
$newSelf->createSubscriptionGroup;
return $newSelf;
}
#----------------------------------------------------------------------------
=head2 addRevision ( properties [, revisionDate, options ] )
Override addRevision to set skipNotification to 0 for each new revision.
@ -405,6 +422,25 @@ sub notifySubscribers {
#----------------------------------------------------------------------------
=head2 purge ( )
Subclass the method to remove the subscription group.
=cut
sub purge {
my $self = shift;
my $options = shift;
my $group = $self->getSubscriptionGroup();
$group->delete;
$self->next::method($options);
return;
}
#----------------------------------------------------------------------------
=head2 setSkipNotification ( )
Set a flag so that this asset does not send out notifications for this