Fix problems with assetExportHtml. The method needs to be rethought, and make check that one exists before calling it via can/DOES. Fix a problem with duplicating the session, since duplicate is not a class method.
This commit is contained in:
parent
910a0a09dd
commit
be259d803c
2 changed files with 6 additions and 5 deletions
|
|
@ -196,7 +196,7 @@ sub exportAssetCollateral {
|
||||||
}
|
}
|
||||||
|
|
||||||
# open another session to handle printing...
|
# open another session to handle printing...
|
||||||
my $printSession = WebGUI::Session->duplicate;
|
my $printSession = $self->session->duplicate;
|
||||||
|
|
||||||
my $keywordObj = WebGUI::Keyword->new($printSession);
|
my $keywordObj = WebGUI::Keyword->new($printSession);
|
||||||
my $keywords = $keywordObj->findKeywords({
|
my $keywords = $keywordObj->findKeywords({
|
||||||
|
|
|
||||||
|
|
@ -165,9 +165,10 @@ The session doing the full export. Can be used to report status messages.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub exportAssetCollateral {
|
around exportAssetCollateral => sub {
|
||||||
# Lots of copy/paste here from AssetExportHtml.pm, since none of the methods there were
|
# Lots of copy/paste here from AssetExportHtml.pm, since none of the methods there were
|
||||||
# directly useful without ginormous refactoring.
|
# directly useful without ginormous refactoring.
|
||||||
|
my $orig = shift;
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $basepath = shift;
|
my $basepath = shift;
|
||||||
my $args = shift;
|
my $args = shift;
|
||||||
|
|
@ -209,7 +210,7 @@ sub exportAssetCollateral {
|
||||||
$reportSession->output->print(
|
$reportSession->output->print(
|
||||||
' ' . $message . '<br />');
|
' ' . $message . '<br />');
|
||||||
}
|
}
|
||||||
my $exportSession = WebGUI::Session->duplicate;
|
my $exportSession = $self->session->duplicate;
|
||||||
|
|
||||||
# open another session as the user doing the exporting...
|
# open another session as the user doing the exporting...
|
||||||
my $selfdupe = WebGUI::Asset->newById( $exportSession, $self->getId );
|
my $selfdupe = WebGUI::Asset->newById( $exportSession, $self->getId );
|
||||||
|
|
@ -242,8 +243,8 @@ sub exportAssetCollateral {
|
||||||
$reportSession->output->print($reporti18n->get('done'));
|
$reportSession->output->print($reporti18n->get('done'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $self->next::method($basepath, $args, $reportSession);
|
return $self->$orig(@_);
|
||||||
}
|
};
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue