From 869ee404e7faba78fa95687430ba5b9282ccb325 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 4 Nov 2009 15:19:54 -0800 Subject: [PATCH] Remove the skipNotification column for the Subscribably aspect. The duplication caused it to be impossible to turn off notifications, which caused the WikiPage test to fail since there was no template defined for sending notifications. --- docs/upgrades/upgrade_7.8.3-7.8.4.pl | 9 +++++++++ lib/WebGUI/AssetAspect/Subscribable.pm | 26 -------------------------- t/Asset/WikiPage.t | 6 +++++- 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/docs/upgrades/upgrade_7.8.3-7.8.4.pl b/docs/upgrades/upgrade_7.8.3-7.8.4.pl index d8d18459f..95a121a42 100644 --- a/docs/upgrades/upgrade_7.8.3-7.8.4.pl +++ b/docs/upgrades/upgrade_7.8.3-7.8.4.pl @@ -31,6 +31,7 @@ my $quiet; # this line required my $session = start(); # this line required # upgrade functions go here +dropSkipNotification($session); finish($session); # this line required @@ -45,6 +46,14 @@ finish($session); # this line required #} +#------------------------------------------------------------------------ +sub dropSkipNotification { + my $session = shift; + print "\tRemoving duplicate skipNotification field from the Subscribable aspect... " unless $quiet; + $session->db->write('alter table assetAspect_Subscribable drop column skipNotification'); + print "Done.\n" unless $quiet; +} + # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/AssetAspect/Subscribable.pm b/lib/WebGUI/AssetAspect/Subscribable.pm index bada309bd..7ed94f1ef 100644 --- a/lib/WebGUI/AssetAspect/Subscribable.pm +++ b/lib/WebGUI/AssetAspect/Subscribable.pm @@ -44,11 +44,6 @@ sub definition { label => $i18n->get("Email Template"), hoverHelp => $i18n->get("Email Template help"), }, - skipNotification => { - autoGenerate => 0, - noFormPost => 1, - fieldType => 'yesNo', - }, ); push @{ $definition }, { @@ -441,27 +436,6 @@ sub purge { #---------------------------------------------------------------------------- -=head2 setSkipNotification ( ) - -Set a flag so that this asset does not send out notifications for this -revision. - -=cut - -sub setSkipNotification { - my $self = shift; - my $value = shift; - $value = defined $value ? $value : 1; - - $self->update( { - skipNotification => $value, - } ); - - return; -} - -#---------------------------------------------------------------------------- - =head2 shouldSkipNotification ( ) Returns true if the asset should skip notifications. diff --git a/t/Asset/WikiPage.t b/t/Asset/WikiPage.t index f2bbe7d80..85b923bda 100644 --- a/t/Asset/WikiPage.t +++ b/t/Asset/WikiPage.t @@ -29,7 +29,11 @@ addToCleanup($versionTag); my $wiki = $node->addChild({className=>'WebGUI::Asset::Wobject::WikiMaster'}); $versionTag->commit; -my $wikipage = $wiki->addChild({className=>'WebGUI::Asset::WikiPage'}, undef, undef, {skipAutoCommitWorkflows => 1}); +my $wikipage = $wiki->addChild( + {className=>'WebGUI::Asset::WikiPage'}, + undef, undef, + {skipAutoCommitWorkflows => 1, skipNotification => 1} +); # Wikis create and autocommit a version tag when a child is added. Lets get the name so we can roll it back. my $secondVersionTag = WebGUI::VersionTag->new($session,$wikipage->get("tagId"));