When duplicating a CS with now children, clear out the replies and threads. When duplicating with children, recalculate them again, since duplicating clears them. Fixes bug #11347.

Note, the lastPostId and lastPostDate are cleared, and gone.  There is no way to recover it after duplicating the branch since
the creationDates and revisionDates are reset when duplicating.
This commit is contained in:
Colin Kuskie 2010-01-18 14:59:34 -08:00
parent 6fe662ef83
commit 97338ffefe
2 changed files with 21 additions and 3 deletions

View file

@ -10,6 +10,7 @@
- fixed #11351: Double submits on ITransact checkout
- fixed #11353: shop - sales - error
- fixed #11355: Duplicate template error
- fixed #11347: copy forum
7.8.9
- fixed #11235: wiki search

View file

@ -932,7 +932,8 @@ sub definition {
=head2 duplicate
Extend the base method to handle making a subscription group for the new CS.
Extend the base method to handle making a subscription group for the new CS, and
to build a new Cron job. It also recalculates the number of threads and replies.
=cut
@ -949,8 +950,24 @@ sub duplicate {
parameters=>$self->getId,
workflowId=>"csworkflow000000000001"
});
$self->update({getMailCronId=>$newCron->getId});
return $newAsset;
$newAsset->update({getMailCronId=>$newCron->getId});
$newAsset->incrementReplies('','');
return $newAsset;
}
#-------------------------------------------------------------------
=head2 duplicateBranch.
Extend the base method to recalculate the number of threads and replies.
=cut
sub duplicateBranch {
my $self = shift;
my $newAsset = $self->next::method(@_);
$newAsset->incrementReplies('','');
return $newAsset;
}
#-------------------------------------------------------------------