fixed: issue with asset export HTML and putting head tags ABOVE <!doctype> and <html> tags. Now creates

a new session for each asset that it exports.
fixed: Widget gear now does not move user to a different part of the page
added a nice error message when the Widget macro can't find a URL.
This commit is contained in:
Doug Bell 2008-07-18 21:09:11 +00:00
parent 31659b00a4
commit 6f90867d26
4 changed files with 19 additions and 12 deletions

View file

@ -1,5 +1,9 @@
7.5.18
- fixed: Product no longer shows "Continue Shopping" view when a different user adds the Product to their Cart. The issue was the Product cached itself when an item was added to the cart. Now it checks for if a cart asset exists for this session.
- fixed: HTML Export now creates a new session for each asset it exports to
stop problems from certain flags that get set once per session.
- fixed: Clicking on Widget gear causes user to jump to another part of the page.
7.5.17
- fixed: Payment Methods Hover Help Incomplete
- fixed: Payment Method Titles Don't Match Buttons

View file

@ -270,24 +270,24 @@ sub exportAsHtml {
my $assetIds = $self->exportGetDescendants($user, $depth);
# now, create a new session as the user doing the exports. this is so that
# the exported assets are taken from that user's perspective.
my $exportSession = WebGUI::Session->open($self->session->config->getWebguiRoot, $self->session->config->getFilename);
$exportSession->user( { userId => $userId } );
# make sure this user can view the top level asset we're exporting. if not,
# don't do anything.
unless ( $self->canView($userId) ) {
$returnCode = 0;
$message = "can't view asset at URL " . $self->getUrl;
$exportSession->var->end;
$exportSession->close;
return ($returnCode, $message);
}
my $exportedCount = 0;
foreach my $assetId ( @{$assetIds} ) {
# now, create a new session as the user doing the exports. this is so that
# the exported assets are taken from that user's perspective.
# Must be created once for each asset, since session is supposed to only handle
# one main asset
my $exportSession = WebGUI::Session->open($self->session->config->getWebguiRoot, $self->session->config->getFilename);
$exportSession->user( { userId => $userId } );
# set a scratch variable for widgets to know we're exporting
$exportSession->scratch->set('exportUrl', $exportUrl);
@ -347,6 +347,9 @@ sub exportAsHtml {
unless( $quiet ) {
$session->output->print($i18n->get('done'));
}
$exportSession->var->end;
$exportSession->close;
}
# handle symlinking
@ -368,10 +371,6 @@ sub exportAsHtml {
}
}
# we don't need the session any more, so close it.
$exportSession->var->end;
$exportSession->close;
# we're done. give the user a status report.
$returnCode = 1;
my $timeRequired = $session->datetime->time - $startTime;

View file

@ -50,6 +50,9 @@ sub process {
# construct the absolute URL and get the asset ID
my $asset = WebGUI::Asset->newByUrl($session, $url);
if ( !$asset ) {
return "Widget: Could not find asset with URL '$url'";
}
my $assetId = $asset->getId;
# ... and the full URL. If there's an exportWidget scratch variable, we're

View file

@ -136,7 +136,8 @@ WebGUI.widgetBox = {
YAHOO.util.Event.addListener("show" + params.assetId, "click", WebGUI.widgetBox.handleButtonShow, codeGeneratorButton, true);
},
handleButtonShow : function() {
handleButtonShow : function(e) {
e.preventDefault();
codeGeneratorButton.show();
var tag = document.getElementById('jsWidgetCode');
tag.focus();