Skip to content
Permalink
Browse files

Make exporting assets as HTML work when an export with mobile styling…

… has been selected. Fixes bug #12364
  • Loading branch information...
perlDreamer committed May 27, 2012
1 parent 70c9939 commit ee783e73743e5008532a74f99d8899ae43aa6a1f
Showing with 14 additions and 3 deletions.
  1. +1 −0 docs/changelog/7.x.x.txt
  2. +13 −3 lib/WebGUI/AssetExportHtml.pm
@@ -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
@@ -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;

0 comments on commit ee783e7

Please sign in to comment.
You can’t perform that action at this time.