diff --git a/docs/upgrades/packages-7.7.0/root_import_storymanager_storytopic.wgpkg b/docs/upgrades/packages-7.7.0/root_import_storymanager_storytopic.wgpkg index 991bf8a45..03ddf7951 100644 Binary files a/docs/upgrades/packages-7.7.0/root_import_storymanager_storytopic.wgpkg and b/docs/upgrades/packages-7.7.0/root_import_storymanager_storytopic.wgpkg differ diff --git a/lib/WebGUI/Asset/Wobject/StoryTopic.pm b/lib/WebGUI/Asset/Wobject/StoryTopic.pm index 35cb20b23..035f30b7b 100644 --- a/lib/WebGUI/Asset/Wobject/StoryTopic.pm +++ b/lib/WebGUI/Asset/Wobject/StoryTopic.pm @@ -168,6 +168,7 @@ sub viewTemplateVariables { ##Note, this could have saved from the loop above, but this looks more clean and encapsulated to me. my $topStory = WebGUI::Asset->new($session, $topStoryData->{assetId}, $topStoryData->{className}, $topStoryData->{revisionDate}); $var->{topStoryTitle} = $topStory->getTitle; + $var->{topStorySubtitle} = $topStory->get('subtitle'); $var->{topStoryUrl} = $session->url->append($self->getUrl, 'func=viewStory;assetId='.$topStoryData->{assetId}), $var->{topStoryCreationDate} = $topStory->get('creationDate'); ##TODO: Photo variables diff --git a/lib/WebGUI/Help/Asset_StoryTopic.pm b/lib/WebGUI/Help/Asset_StoryTopic.pm index e5418a4b0..dc1e7bf0b 100644 --- a/lib/WebGUI/Help/Asset_StoryTopic.pm +++ b/lib/WebGUI/Help/Asset_StoryTopic.pm @@ -28,6 +28,7 @@ our $HELP = { ], }, { name => 'topStoryTitle' }, + { name => 'topStorySubtitle' }, { name => 'topStoryUrl' }, { name => 'topStoryCreationDate' }, ], diff --git a/lib/WebGUI/i18n/English/Asset_StoryTopic.pm b/lib/WebGUI/i18n/English/Asset_StoryTopic.pm index 574e24037..de29aa089 100644 --- a/lib/WebGUI/i18n/English/Asset_StoryTopic.pm +++ b/lib/WebGUI/i18n/English/Asset_StoryTopic.pm @@ -93,6 +93,12 @@ our $I18N = { lastUpdated => 0, }, + 'topStorySubtitle' => { + message => q|The subtitle of the top story.|, + context => q|Template variable.|, + lastUpdated => 0, + }, + 'topStoryCreationDate' => { message => q|The epoch date when the top story was created, or submitted, to its Story Archive.|, context => q|Template variable.|, diff --git a/t/Asset/Wobject/StoryTopic.t b/t/Asset/Wobject/StoryTopic.t index d7e3c093e..342c97ddc 100644 --- a/t/Asset/Wobject/StoryTopic.t +++ b/t/Asset/Wobject/StoryTopic.t @@ -31,7 +31,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -my $tests = 10; +my $tests = 11; plan tests => 1 + $tests; #---------------------------------------------------------------------------- @@ -69,6 +69,8 @@ STORY: foreach my $name (@characters) { $creationDateSth->execute([$now, $namedStory->getId]); } +$storyHandler->{bogs}->update({subtitle => 'drinking his food through a straw'}); + my $topic; SKIP: { @@ -116,7 +118,8 @@ cmp_deeply( ok( ! exists $templateVars->{topStoryTitle} && ! exists $templateVars->{topStoryUrl} - && ! exists $templateVars->{topStoryCreationDate}, + && ! exists $templateVars->{topStoryCreationDate} + && ! exists $templateVars->{topStorySubtitle}, 'topStory variables not present unless in standalone mode' ); ok(! $templateVars->{standAlone}, 'viewTemplateVars: not in standalone mode'); @@ -156,6 +159,11 @@ cmp_deeply( ); is($templateVars->{topStoryTitle}, 'bogs', 'viewTemplateVars in standalone mode, title'); +is( + $templateVars->{topStorySubtitle}, + 'drinking his food through a straw', + 'viewTemplateVars in standalone mode, subtitle' +); is( $templateVars->{topStoryUrl}, $session->url->append($topic->getUrl, 'func=viewStory;assetId='.$storyHandler->{'bogs'}->getId),