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.
This commit is contained in:
Colin Kuskie 2009-11-04 15:19:54 -08:00
parent f9d97f2ce7
commit 869ee404e7
3 changed files with 14 additions and 27 deletions

View file

@ -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 --------------------------------
#----------------------------------------------------------------------------

View file

@ -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.

View file

@ -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"));