From 794b26d3251beb85b9dcc3440ec38b160a1a3b26 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 6 Apr 2010 19:30:35 -0700 Subject: [PATCH] Moose override commit in Thread and CS. --- lib/WebGUI/Asset/Post/Thread.pm | 14 +++++++------- lib/WebGUI/Asset/Wobject/Collaboration.pm | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index e8d86a98e..3c455cdb9 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -172,13 +172,13 @@ Extends the base method to increment the number of threads in the parent CS. =cut -sub commit { - my $self = shift; - $self->SUPER::commit; - if ($self->isNew) { - $self->getParent->incrementThreads($self->revisionDate,$self->getId); - } -} +override commit => sub { + my $self = shift; + super(); + if ($self->isNew) { + $self->getParent->incrementThreads($self->revisionDate,$self->getId); + } +}; #------------------------------------------------------------------- # Override duplicateBranch here so that new posts get their threadId set correctly. diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 400a5b318..c6b820037 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -874,9 +874,9 @@ in that case. =cut -sub commit { +override commit => sub { my $self = shift; - $self->next::method; + super(); my $cron = undef; if ($self->getMailCronId) { $cron = WebGUI::Workflow::Cron->new($self->session, $self->getMailCronId); @@ -898,7 +898,7 @@ sub commit { } else { $cron->set({enabled=>0,title=>$self->getTitle." ".$i18n->get("mail"), minuteOfHour=>"*/".($self->getMailInterval/60)}); } -} +}; #-------------------------------------------------------------------