Fix stories linking to keyword pages after export. Fixes bug #12035.
This commit is contained in:
parent
1df5429323
commit
bb584ec910
3 changed files with 36 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
7.10.10
|
||||
- fixed #12035: Story Manager - make keywords from Story view work
|
||||
|
||||
7.10.9
|
||||
- fixed #12030: Calendar Feed Time Zone Issue
|
||||
|
|
|
|||
|
|
@ -884,13 +884,23 @@ sub viewTemplateVariables {
|
|||
}
|
||||
}
|
||||
|
||||
my $key = WebGUI::Keyword->new($session);
|
||||
my $keywords = $key->getKeywordsForAsset( { asArrayRef => 1, asset => $self });
|
||||
my $isExporting = $session->scratch->get('isExporting');
|
||||
my $key = WebGUI::Keyword->new($session);
|
||||
my $keywords = $key->getKeywordsForAsset( { asArrayRef => 1, asset => $self });
|
||||
$var->{keyword_loop} = [];
|
||||
my $parent = $self->getParent;
|
||||
my $upwards = $parent->isa('WebGUI::Asset::Wobject::StoryArchive')
|
||||
? '' #In parallel with the Keywords files
|
||||
: '../' #Keywords files are one level up
|
||||
;
|
||||
foreach my $keyword (@{ $keywords }) {
|
||||
my $keyword_url = $isExporting
|
||||
? $upwards . $archive->getKeywordFilename($keyword)
|
||||
: $archive->getUrl("func=view;keyword=".$session->url->escape($keyword))
|
||||
;
|
||||
push @{ $var->{keyword_loop} }, {
|
||||
keyword => $keyword,
|
||||
url => $archive->getUrl("func=view;keyword=".$session->url->escape($keyword)),
|
||||
url => $keyword_url,
|
||||
};
|
||||
}
|
||||
$var->{updatedTime} = $self->formatDuration();
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ WebGUI::Test->addToCleanup($storage1, $storage2);
|
|||
#
|
||||
############################################################
|
||||
|
||||
my $tests = 45;
|
||||
my $tests = 46;
|
||||
plan tests => 1
|
||||
+ $tests
|
||||
+ $canEditMaker->plan
|
||||
|
|
@ -444,5 +444,26 @@ cmp_bag(
|
|||
'...asset package data has the storage locations in it'
|
||||
);
|
||||
|
||||
############################################################
|
||||
#
|
||||
# keyword variables in export mode
|
||||
#
|
||||
############################################################
|
||||
|
||||
$session->scratch->set('isExporting', 1);
|
||||
|
||||
my $keyword_loop = $story->viewTemplateVariables->{keyword_loop};
|
||||
cmp_bag(
|
||||
$keyword_loop,
|
||||
[
|
||||
{ keyword => "foxtrot", url => '../keyword_foxtrot.html', },
|
||||
{ keyword => "tango", url => '../keyword_tango.html', },
|
||||
{ keyword => "whiskey", url => '../keyword_whiskey.html', },
|
||||
],
|
||||
'viewTemplateVariables: keywords_loop is okay'
|
||||
) or diag Dumper( $keyword_loop );
|
||||
$session->scratch->delete('isExporting');
|
||||
|
||||
|
||||
}
|
||||
#vim:ft=perl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue