Set correct defaults for icalFeeds in existant calendars. Fixes bug #11005

This commit is contained in:
Colin Kuskie 2009-09-17 15:36:58 -07:00
parent 7349cf52b8
commit 255abcdf97
3 changed files with 38 additions and 1 deletions

View file

@ -48,6 +48,7 @@
- fixed #10954: DataForm fails silently
- fixed #10950: Thingy
- fixed #10976: Form::Date not internationalized /DateTime::setToEpoch
- fixed #11005: calendar feed workflow
7.7.19
- fixed #10838: Forwarded forum post email to new CS adds reply to original thread

View file

@ -36,6 +36,7 @@ fixTemplateSettingsFromShunt($session);
addSubscribableAspect( $session );
addMatrixColumnDefaults($session);
addFeaturedPageWiki( $session );
fixEmptyCalendarIcalFeeds( $session );
finish($session); # this line required
@ -49,6 +50,19 @@ finish($session); # this line required
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
# Add the column for featured wiki pages
sub fixEmptyCalendarIcalFeeds {
my $session = shift;
print "\tSetting icalFeeds in the Calendar to the proper default... " unless $quiet;
$session->db->write(
"UPDATE Calendar set icalFeeds='[]' where icalFeeds IS NULL",
);
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Add the column for featured wiki pages
sub addFeaturedPageWiki {

View file

@ -57,7 +57,7 @@ use Data::Dumper;
use WebGUI::Asset::Wobject::Calendar;
use WebGUI::Asset::Event;
plan tests => 14 + scalar @icalWrapTests;
plan tests => 15 + scalar @icalWrapTests;
my $session = WebGUI::Test->session;
@ -434,6 +434,28 @@ cmp_deeply(
'... end of day event in proper bin'
);
######################################################################
#
# getFeeds
#
######################################################################
my $feedCal = $node->addChild({
className => 'WebGUI::Asset::Wobject::Calendar',
title => 'Calendar for doing feed tests',
});
my $feedTag = WebGUI::VersionTag->getWorking($session);
$feedTag->set({name=>"Calendar Feed Test"});
WebGUI::Test->tagsToRollback($feedTag);
$feedTag->commit;
cmp_deeply(
$feedCal->getFeeds(),
[],
'getFeeds: returns an empty array ref with no feeds'
);
TODO: {
local $TODO = "Tests to make later";
ok(0, 'Lots more to test');