few more bug fixes and preparing for 7.0.3 release

This commit is contained in:
JT Smith 2006-07-26 20:05:43 +00:00
parent ebc3db0725
commit 07301c12bd
8 changed files with 57 additions and 27 deletions

View file

@ -425,28 +425,34 @@ sub runJobResponse {
my $id = $request->header("X-jobId"); # got to figure out how to get this from the request, cuz the response may die
$self->debug("Response retrieved is for job $id.");
if ($response->is_success) {
$self->debug("Response for job $id retrieved successfully.");
if ($response->header("Set-Cookie") ne "") {
$self->debug("Storing cookie for $id for later use.");
my $cookie = $response->header("Set-Cookie");
$cookie =~ s/wgSession=([a-zA-Z0-9\_\-]{22}).*/$1/;
$self->{_cookies}{$self->getJob($id)->{sitename}} = $cookie;
}
my $state = $response->content;
if ($state eq "done") {
delete $self->{_errorCount}{$id};
$self->debug("Job $id is now complete.");
if ($self->getJob($id)->{runOnce}) {
$kernel->yield("deleteJob",$id);
my $job = $self->getJob($id);
if (defined $job && ref $job eq "HASH") {
$self->debug("Response for job $id retrieved successfully.");
if ($response->header("Set-Cookie") ne "") {
$self->debug("Storing cookie for $id for later use.");
my $cookie = $response->header("Set-Cookie");
$cookie =~ s/wgSession=([a-zA-Z0-9\_\-]{22}).*/$1/;
$self->{_cookies}{$job->{sitename}} = $cookie;
}
my $state = $response->content;
if ($state eq "done") {
delete $self->{_errorCount}{$id};
$self->debug("Job $id is now complete.");
if ($job->{runOnce}) {
$kernel->yield("deleteJob",$id);
}
} elsif ($state eq "error") {
$self->{_errorCount}{$id}++;
$self->debug("Got an error response for job $id, will try again in ".$self->config->get("suspensionDelay")." seconds.");
$kernel->delay_set("runJob",$self->config->get("suspensionDelay"),$id);
} else {
$self->{_errorCount}{$id}++;
$self->error("Something bad happened on the return of job $id, will try again in ".$self->config->get("suspensionDelay")." seconds. ".$response->error_as_HTML);
$kernel->delay_set("runJob",$self->config->get("suspensionDelay"),$id);
}
} elsif ($state eq "error") {
$self->{_errorCount}{$id}++;
$self->debug("Got an error response for job $id, will try again in ".$self->config->get("suspensionDelay")." seconds.");
$kernel->delay_set("runJob",$self->config->get("suspensionDelay"),$id);
} else {
$self->{_errorCount}{$id}++;
$self->error("Something bad happened on the return of job $id, will try again in ".$self->config->get("suspensionDelay")." seconds. ".$response->error_as_HTML);
$kernel->delay_set("runJob",$self->config->get("suspensionDelay"),$id);
$self->error("Job $id is not in our queue.");
}
} elsif ($response->is_redirect) {
$self->error("Response for $id was redirected. This should never happen if configured properly!!!");

View file

@ -299,7 +299,10 @@ Returns the extraHeadTags stored in the asset. Called in $self->session->style-
sub getExtraHeadTags {
my $self = shift;
return $self->get("extraHeadTags")."\n".$self->getShortcut->get("extraHeadTags");
my $output = $self->get("extraHeadTags")."\n";
my $shortcut = $self->getShortcut;
$output .= $self->getShortcut->get("extraHeadTags") if defined $shortcut;
return $output;
}
#-------------------------------------------------------------------

View file

@ -115,7 +115,6 @@ sub www_deleteWorkflowActivity {
my $workflow = WebGUI::Workflow->new($session, $session->form->get("workflowId"));
if (defined $workflow) {
$workflow->deleteActivity($session->form->get("activityId"));
$workflow->set({enabled=>0});
}
return www_editWorkflow($session);
}

View file

@ -69,7 +69,7 @@ sub definition {
label=>$i18n->get("run once"),
hoverHelp=>$i18n->get("run once help")
},
workflowId=>{
workflowIdToRun=>{
fieldType=>"workflow",
defaultValue=>undef,
label=>$i18n->get("workflow"),
@ -137,7 +137,7 @@ sub execute {
title=>"Generated by workflow instance ".$instance->getId." (".$self->get("title").")",
enabled=>$self->get("enabled"),
runOnce=>$self->get("runOnce"),
workflowId=>$self->get("workflowId"),
workflowId=>$self->get("workflowIdToRun"),
priority=>$self->get("priority"),
minuteOfHour=>$self->get("minuteOfHour"),
hourOfDay=>$self->get("hourOfDay"),