Give StoryArchive sub-folders the same style as their parent. Fix to hide them

better upcoming.
This commit is contained in:
Colin Kuskie 2009-07-23 21:17:25 +00:00
parent 20814beefd
commit c9fa63bdb7
3 changed files with 28 additions and 18 deletions

View file

@ -29,6 +29,7 @@
- fixed #10651: Dashboard Content positions - fixed #10651: Dashboard Content positions
- fixed #10695: Adding a new article creates a new version tag - fixed #10695: Adding a new article creates a new version tag
- fixed #10693: double titels in help for Story Archive view template - fixed #10693: double titels in help for Story Archive view template
- fixed Story Archive sub-folders should not use the failsafe style.
7.7.15 7.7.15
- fixed #10629: WebGUI::ProfileField create new field bug - fixed #10629: WebGUI::ProfileField create new field bug

View file

@ -322,11 +322,12 @@ sub getFolder {
##Call SUPER because my addChild calls getFolder ##Call SUPER because my addChild calls getFolder
$folder = $self->SUPER::addChild({ $folder = $self->SUPER::addChild({
className => 'WebGUI::Asset::Wobject::Folder', className => 'WebGUI::Asset::Wobject::Folder',
title => $folderName, title => $folderName,
menuTitle => $folderName, menuTitle => $folderName,
url => $folderUrl, url => $folderUrl,
isHidden => 1, isHidden => 1,
styleTemplateId => $self->get('styleTemplateId'),
}); });
$newVersionTag->commit(); $newVersionTag->commit();
##Restore the old one, if it exists ##Restore the old one, if it exists

View file

@ -63,7 +63,7 @@ $canPostMaker->prepare({
fail => [1, $reader ], fail => [1, $reader ],
}); });
my $tests = 45 my $tests = 46
+ $canPostMaker->plan + $canPostMaker->plan
; ;
plan tests => 1 plan tests => 1
@ -83,8 +83,14 @@ my $creationDateSth = $session->db->prepare('update asset set creationDate=? whe
SKIP: { SKIP: {
skip "Unable to load module $class", $tests unless $loaded; skip "Unable to load module $class", $tests unless $loaded;
my $home = WebGUI::Asset->getDefault($session);
$archive = WebGUI::Asset->getDefault($session)->addChild({className => $class, title => 'My Stories', url => '/home/mystories'}); $archive = $home->addChild({
className => $class,
title => 'My Stories',
url => '/home/mystories',
styleTemplateId => $home->get('styleTemplateId'),
});
$versionTag = WebGUI::VersionTag->getWorking($session); $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit; $versionTag->commit;
@ -118,16 +124,17 @@ $canPostMaker->run();
my $now = time(); my $now = time();
my $todayFolder = $archive->getFolder($now); my $todayFolder = $archive->getFolder($now);
isa_ok($todayFolder, 'WebGUI::Asset::Wobject::Folder', 'getFolder created a Folder'); isa_ok($todayFolder, 'WebGUI::Asset::Wobject::Folder', 'getFolder created a Folder');
is($archive->getChildCount, 1, 'getFolder created a child'); is($archive->getChildCount, 1, '... created a child');
my $dt = DateTime->from_epoch(epoch => $now, time_zone => $session->datetime->getTimeZone); my $dt = DateTime->from_epoch(epoch => $now, time_zone => $session->datetime->getTimeZone);
my $folderName = $dt->strftime('%B_%d_%Y'); my $folderName = $dt->strftime('%B_%d_%Y');
$folderName =~ s/^(\w+_)0/$1/; $folderName =~ s/^(\w+_)0/$1/;
is($todayFolder->getTitle, $folderName, 'getFolder: folder has the right name'); is($todayFolder->getTitle, $folderName, '... folder has the right name');
my $folderUrl = join '/', $archive->getUrl, lc $folderName; my $folderUrl = join '/', $archive->getUrl, lc $folderName;
is($todayFolder->getUrl, $folderUrl, 'getFolder: folder has the right URL'); is($todayFolder->getUrl, $folderUrl, '... folder has the right URL');
is($todayFolder->getParent->getId, $archive->getId, 'getFolder: created folder has the right parent'); is($todayFolder->getParent->getId, $archive->getId, '... created folder has the right parent');
is($todayFolder->get('state'), 'published', 'getFolder: created folder is published'); is($todayFolder->get('state'), 'published', '... created folder is published');
is($todayFolder->get('status'), 'approved', 'getFolder: created folder is approved'); is($todayFolder->get('status'), 'approved', '... created folder is approved');
is($todayFolder->get('styleTemplateId'), $archive->get('styleTemplateId'), '... created folder has correct styleTemplateId');
my $sameFolder = $archive->getFolder($now); my $sameFolder = $archive->getFolder($now);
is($sameFolder->getId, $todayFolder->getId, 'call with same time returns the same folder'); is($sameFolder->getId, $todayFolder->getId, 'call with same time returns the same folder');
@ -558,11 +565,12 @@ $archive->exportAssetCollateral($assetFile, {}, $session);
my $exportedFiles = $exportStorage->getFiles(); my $exportedFiles = $exportStorage->getFiles();
cmp_bag( cmp_bag(
$exportedFiles, $exportedFiles,
[qw/ [qw{
mystories.rss mystories mystories.rss mystories
mystories.atom mystories.atom mystories.rdf
mystories.rdf mystories/index.html mystories/keyword_echo.html
/], mystories/keyword_roger.html mystories/keyword_foxtrot.html
}],
'exportAssetCollateral: feed files exported' 'exportAssetCollateral: feed files exported'
); );