preparing for 7.0.5 release

fixed some bugs
This commit is contained in:
JT Smith 2006-08-09 16:09:17 +00:00
parent 3000fccb79
commit dfe92a73e2
7 changed files with 97 additions and 20 deletions

View file

@ -10,6 +10,10 @@
- fix: Redirects get displayed inside page layouts as '0' - fix: Redirects get displayed inside page layouts as '0'
- fix: Mysterious "0" Appearing When Admin Is Off - fix: Mysterious "0" Appearing When Admin Is Off
- fix: Deletion of Products - fix: Deletion of Products
- fix: Request Tracker Thread is called Request Tracker Post
- fix: asset constructor new, does not return undef as documented
- fix: Static export in html not working through the workflow
7.0.4 7.0.4
- Added a forum.lastPost.user.hasRead variable to the Message Board template. - Added a forum.lastPost.user.hasRead variable to the Message Board template.

File diff suppressed because one or more lines are too long

View file

@ -12,7 +12,7 @@ use lib "../../lib";
use strict; use strict;
use Getopt::Long; use Getopt::Long;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Asset;
my $toVersion = "7.0.5"; # make this match what version you're going to my $toVersion = "7.0.5"; # make this match what version you're going to
my $quiet; # this line required my $quiet; # this line required
@ -20,17 +20,18 @@ my $quiet; # this line required
my $session = start(); # this line required my $session = start(); # this line required
# upgrade functions go here renameTemplate();
finish($session); # this line required finish($session); # this line required
##------------------------------------------------- #-------------------------------------------------
#sub exampleFunction { sub renameTemplate {
# my $session = shift; print "\tRenaming a template.\n" unless ($quiet);
# print "\tWe're doing some stuff here that you should know about.\n" unless ($quiet); my $asset = WebGUI::Asset->new($session, "PBtmpl0000000000000209", "WebGUI::Asset::Template");
# # and here's our code if (defined $asset) {
#} $asset->update({title=>"Request Tracker Thread",menuTitle=>"Request Tracker Thread"});
}
}

View file

@ -1386,8 +1386,11 @@ sub new {
my $class = shift; my $class = shift;
my $session = shift; my $session = shift;
my $assetId = shift; my $assetId = shift;
return undef unless ($assetId);
my $className = shift; my $className = shift;
unless (defined $assetId) {
$session->errorHandler->error("Asset constructor new() requires an assetId.");
return undef;
}
my $assetRevision = $session->stow->get("assetRevision"); my $assetRevision = $session->stow->get("assetRevision");
my $revisionDate = shift || $assetRevision->{$assetId}{$session->scratch->get("versionTag")||'_'}; my $revisionDate = shift || $assetRevision->{$assetId}{$session->scratch->get("versionTag")||'_'};
unless ($revisionDate) { unless ($revisionDate) {

View file

@ -67,6 +67,73 @@ sub checkExportPath {
return $error; return $error;
} }
#-------------------------------------------------------------------
=head2 exportAsHtml
Same as www_exportGenerate except without the output. Returns "success" if successful, otherwise returns an error message.
=cut
sub exportAsHtml {
my $self = shift;
my $error = $self->checkExportPath();
if ($error) {
return $error;
}
my $userId = '1';
my $index = "index.html";
# Change the stuff we need to change to do the export
my $newSession = WebGUI::Session->open($self->session->config->getWebguiRoot, $self->session->config->getFilename);
my $newSelf = WebGUI::Asset->new($newSession, $self->getId, $self->get("className"), $self->get("revisionDate"));
my $assets = $newSelf->getLineage(["self","descendants"],{returnObjects=>1,endingLineageLength=>$newSelf->getLineageLength+$self->session->form->process("depth")});
$newSession->user({userId=>$userId});
foreach my $asset (@{$assets}) {
my $url = $asset->get("url");
unless ($asset->canView($userId)) {
next;
}
my $path;
my $filename;
if ($url =~ /\./) {
$url =~ /^(.*)\/(.*)$/;
$path = $1;
$filename = $2;
if ($filename eq "") {
$filename = $path;
$path = undef;
}
} else {
$path = $url;
$filename = $index;
}
if($path) {
$path = $self->session->config->get("exportPath") . "/" . $path;
eval { mkpath($path) };
if($@) {
return "Couldn't create path";
}
}
$path .= "/".$filename;
my $file = eval { FileHandle->new(">".$path) or die "$!" };
if ($@) {
return "couldn't open path";
} else {
$newSession->output->setHandle($file);
my $content = $asset->www_view;
unless ($content eq "chunked") {
$newSession->output->print($content);
}
$file->close;
}
}
$newSession->var->end;
$newSession->close;
return "success";
}
#------------------------------------------------------------------- #-------------------------------------------------------------------

View file

@ -403,6 +403,8 @@ sub send {
} }
} }
} }
# due to the large number of emails that may be generated by sending emails to a group,
# emails to members of a group are queued rather than sent directly
my $group = $self->{_toGroup}; my $group = $self->{_toGroup};
delete $self->{_toGroup}; delete $self->{_toGroup};
if ($group) { if ($group) {
@ -413,9 +415,7 @@ sub send {
my $user = WebGUI::User->new($self->session, $userId); my $user = WebGUI::User->new($self->session, $userId);
if ($user->profileField("email")) { if ($user->profileField("email")) {
$self->{_message}->head->replace("To",$user->profileField("email")); $self->{_message}->head->replace("To",$user->profileField("email"));
unless ($self->send) { $self->queue;
$status = 0;
}
} }
} }
} }

View file

@ -71,8 +71,10 @@ sub execute {
my $self = shift; my $self = shift;
my $versionTag = shift; my $versionTag = shift;
foreach my $asset (@{$versionTag->getAssets}) { foreach my $asset (@{$versionTag->getAssets}) {
$asset->exportAsHtml(); my $status = $asset->exportAsHtml();
$asset->getContainer->exportAsHtml(); return $self->ERROR unless ($status eq "success");
$status = $asset->getContainer->exportAsHtml();
return $self->ERROR unless ($status eq "success");
} }
return $self->COMPLETE; return $self->COMPLETE;
} }