preparing for 7.0.5 release
fixed some bugs
This commit is contained in:
parent
3000fccb79
commit
dfe92a73e2
7 changed files with 97 additions and 20 deletions
|
|
@ -10,6 +10,10 @@
|
|||
- fix: Redirects get displayed inside page layouts as '0'
|
||||
- fix: Mysterious "0" Appearing When Admin Is Off
|
||||
- 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
|
||||
- Added a forum.lastPost.user.hasRead variable to the Message Board template.
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -12,7 +12,7 @@ use lib "../../lib";
|
|||
use strict;
|
||||
use Getopt::Long;
|
||||
use WebGUI::Session;
|
||||
|
||||
use WebGUI::Asset;
|
||||
|
||||
my $toVersion = "7.0.5"; # make this match what version you're going to
|
||||
my $quiet; # this line required
|
||||
|
|
@ -20,17 +20,18 @@ my $quiet; # this line required
|
|||
|
||||
my $session = start(); # this line required
|
||||
|
||||
# upgrade functions go here
|
||||
|
||||
renameTemplate();
|
||||
finish($session); # this line required
|
||||
|
||||
|
||||
##-------------------------------------------------
|
||||
#sub exampleFunction {
|
||||
# my $session = shift;
|
||||
# print "\tWe're doing some stuff here that you should know about.\n" unless ($quiet);
|
||||
# # and here's our code
|
||||
#}
|
||||
#-------------------------------------------------
|
||||
sub renameTemplate {
|
||||
print "\tRenaming a template.\n" unless ($quiet);
|
||||
my $asset = WebGUI::Asset->new($session, "PBtmpl0000000000000209", "WebGUI::Asset::Template");
|
||||
if (defined $asset) {
|
||||
$asset->update({title=>"Request Tracker Thread",menuTitle=>"Request Tracker Thread"});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1386,8 +1386,11 @@ sub new {
|
|||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $assetId = shift;
|
||||
return undef unless ($assetId);
|
||||
my $className = shift;
|
||||
unless (defined $assetId) {
|
||||
$session->errorHandler->error("Asset constructor new() requires an assetId.");
|
||||
return undef;
|
||||
}
|
||||
my $assetRevision = $session->stow->get("assetRevision");
|
||||
my $revisionDate = shift || $assetRevision->{$assetId}{$session->scratch->get("versionTag")||'_'};
|
||||
unless ($revisionDate) {
|
||||
|
|
|
|||
|
|
@ -67,6 +67,73 @@ sub checkExportPath {
|
|||
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";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
delete $self->{_toGroup};
|
||||
if ($group) {
|
||||
|
|
@ -413,9 +415,7 @@ sub send {
|
|||
my $user = WebGUI::User->new($self->session, $userId);
|
||||
if ($user->profileField("email")) {
|
||||
$self->{_message}->head->replace("To",$user->profileField("email"));
|
||||
unless ($self->send) {
|
||||
$status = 0;
|
||||
}
|
||||
$self->queue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,10 @@ sub execute {
|
|||
my $self = shift;
|
||||
my $versionTag = shift;
|
||||
foreach my $asset (@{$versionTag->getAssets}) {
|
||||
$asset->exportAsHtml();
|
||||
$asset->getContainer->exportAsHtml();
|
||||
my $status = $asset->exportAsHtml();
|
||||
return $self->ERROR unless ($status eq "success");
|
||||
$status = $asset->getContainer->exportAsHtml();
|
||||
return $self->ERROR unless ($status eq "success");
|
||||
}
|
||||
return $self->COMPLETE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue