Make exporting assets as HTML work when an export with mobile styling has been selected. Fixes bug #12364

This commit is contained in:
Colin Kuskie 2012-05-26 20:40:38 -07:00
parent 70c9939169
commit ee783e7374
2 changed files with 14 additions and 3 deletions

View file

@ -14,6 +14,7 @@
- fixed: Cache's setByHTTP method returns content, even when it gets an error in the request. This gives the SC asset fits.
- fixed #12349: Friends invitation error
- fixed #12353: Dataform List mode
- fixed #12364: Site export loses session info
7.10.24
- fixed #12318: asset error causes asset manager to fail

View file

@ -311,8 +311,9 @@ sub exportAsHtml {
sub exportBranch {
my ($self, $options, $reportSession) = @_;
my $session = $self->session;
my $i18n = $reportSession &&
WebGUI::International->new($self->session, 'Asset');
WebGUI::International->new($session, 'Asset');
my $depth = $options->{depth};
my $indexFileName = $options->{indexFileName};
@ -361,13 +362,22 @@ sub exportBranch {
my $exportAsset = sub {
my ( $assetId ) = @_;
# Must be created once for each asset, since session is supposed to only handle
# one main asset
my $outputSession = $self->session->duplicate;
# one main asset. It also cannot be a clone of the current session, since when
# this duplicate is closed it will overwrite the scratch from the original
my $outputSession = WebGUI::Session->open(
$session->config->getWebguiRoot,
$session->config->getFilename,
);
$outputSession->user( { userId => $session->user->getId } );
$outputSession->scratch->set('isExporting', 1);
$outputSession->scratch->set('exportUrl',$session->scratch->get('exportUrl'));
$outputSession->style->setMobileStyle($session->style->useMobileStyle?1:0);
my $osGuard = Scope::Guard->new(sub {
$outputSession->close;
$outputSession = undef;
});
my $asset = WebGUI::Asset->new($outputSession, $assetId);
my $fullPath = $asset->exportGetUrlAsPath;