Merge branch 'master' into WebGUI8

This commit is contained in:
Graham Knop 2010-04-13 07:50:02 -05:00
commit 2400f19099
797 changed files with 33894 additions and 27196 deletions

View file

@ -204,7 +204,7 @@ sub exportAsHtml {
my $i18n = WebGUI::International->new($self->session, 'Asset');
# take down when we started to tell the user how long the process took.
my $startTime = $session->datetime->time;
my $startTime = time;
# get the export path and ensure it is valid.
my $exportPath = $self->exportCheckPath;
@ -297,7 +297,7 @@ sub exportAsHtml {
}
# we're done. give the user a status report.
my $timeRequired = $session->datetime->time - $startTime;
my $timeRequired = time - $startTime;
my $message = sprintf $i18n->get('export information'), $exportedCount, $timeRequired;
return $message;
}
@ -789,14 +789,15 @@ sub exportWriteFile {
my $dest = $self->exportGetUrlAsPath;
my $parent = $dest->parent;
eval { $parent->absolute->mkpath };
if($@) {
WebGUI::Error->throw(error => "could not make directory " . $parent->absolute->stringify);
$parent->absolute->mkpath( {error => \my $err} );
if (@$err) {
(undef, my $message) = %{ $err->[0] };
WebGUI::Error->throw(error => "Could not make directory " . $parent->absolute->stringify . ": " . $message);
}
# next, get the contents, open the file, and write the contents to the file.
my $fh = eval { $dest->open('>:utf8') };
if($@) {
if(! $fh) {
WebGUI::Error->throw(error => "can't open " . $dest->absolute->stringify . " for writing: $!");
}
$self->session->asset($self);
@ -807,6 +808,7 @@ sub exportWriteFile {
unless($contents eq 'chunked') {
$self->session->output->print($contents);
}
$fh->close;
}
#-------------------------------------------------------------------