Do not send emails when a Post or Thread is copied inside WebGUI. Fixes bug #12024.
This commit is contained in:
parent
ca54f439e9
commit
8c2958b042
3 changed files with 41 additions and 4 deletions
|
|
@ -150,6 +150,10 @@ A hash reference of options that can modify how this method works.
|
|||
|
||||
Assets that normally autocommit their workflows (like CS Posts, and Wiki Pages) won't if this is true.
|
||||
|
||||
=head4 skipNotification
|
||||
|
||||
Disable sending a notification that a new revision was added, for those assets that support it.
|
||||
|
||||
=head4 state
|
||||
|
||||
A state for the duplicated asset (defaults to 'published')
|
||||
|
|
@ -160,8 +164,15 @@ sub duplicate {
|
|||
my $self = shift;
|
||||
my $options = shift;
|
||||
my $parent = $self->getParent;
|
||||
##Remove state and pass all other options along to addChild
|
||||
my $asset_state = delete $options->{state};
|
||||
my $newAsset
|
||||
= $parent->addChild( $self->get, undef, $self->get("revisionDate"), { skipAutoCommitWorkflows => $options->{skipAutoCommitWorkflows} } );
|
||||
= $parent->addChild(
|
||||
$self->get,
|
||||
undef,
|
||||
$self->get("revisionDate"),
|
||||
$options,
|
||||
);
|
||||
|
||||
if (! $newAsset) {
|
||||
$self->session->log->error(
|
||||
|
|
@ -189,8 +200,8 @@ sub duplicate {
|
|||
keywords => $keywords,
|
||||
} );
|
||||
|
||||
if (my $state = $options->{state}) {
|
||||
$newAsset->setState($state);
|
||||
if ($asset_state) {
|
||||
$newAsset->setState($asset_state);
|
||||
}
|
||||
|
||||
return $newAsset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue