a ton of $session fixes (thanks to Colin), and a new $session checker, that supposedly, shouldn't be needed now. It can be backed out, however, easily.
This commit is contained in:
parent
5fadc70eac
commit
09483e18c5
208 changed files with 505 additions and 533 deletions
|
|
@ -25,7 +25,7 @@ our @ISA = qw(WebGUI::Asset);
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Event");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ A hash reference passed in from a subclass definition.
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_File");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ A hash reference passed in from a subclass definition.
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Image");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ A hash reference passed in from a subclass definition.
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_ZipArchive");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ sub addRevision {
|
|||
#-------------------------------------------------------------------
|
||||
sub canAdd {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
$class->SUPER::canAdd($session, undef, '7');
|
||||
}
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ sub chopTitle {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Post");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ sub decrementReplies {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Thread");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ A hash reference passed in from a subclass definition.
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Redirect");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ A hash reference passed in from a subclass definition.
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,'Asset_RichEdit');
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ sub canManage {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Shortcut");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ A hash reference passed in from a subclass definition.
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Snippet");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -43,19 +43,9 @@ These methods are available from this class:
|
|||
=cut
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _getTemplateFile {
|
||||
my $templateId = shift;
|
||||
my $filename = $templateId.".tmpl";
|
||||
$filename =~ s/\//-/g;
|
||||
$filename =~ s/ /-/g;
|
||||
return WebGUI::Attachment->new($filename,"temp","templates");
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _execute {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $params = shift;
|
||||
my $vars = shift;
|
||||
my $t;
|
||||
|
|
@ -97,7 +87,7 @@ A hash reference passed in from a subclass definition.
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session, 'Asset_Template');
|
||||
push(@{$definition}, {
|
||||
|
|
@ -201,7 +191,7 @@ Specify the namespace to build the list for.
|
|||
|
||||
sub getList {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $namespace = shift;
|
||||
my $sql = "select asset.assetId, assetData.revisionDate from template left join asset on asset.assetId=template.assetId left join assetData on assetData.revisionDate=template.revisionDate and assetData.assetId=template.assetId where template.namespace=".$session->db->quote($namespace)." and template.showInForms=1 and asset.state='published' and assetData.revisionDate=(SELECT max(revisionDate) from assetData where assetData.assetId=asset.assetId and (assetData.status='approved' or assetData.tagId=".$session->db->quote($session->scratch->get("versionTag")).")) order by assetData.title";
|
||||
my $sth = $session->dbSlave->read($sql);
|
||||
|
|
@ -232,57 +222,9 @@ sub process {
|
|||
my $self = shift;
|
||||
my $vars = shift;
|
||||
return $self->processRaw($self->session, $self->get("template"),$vars);
|
||||
# skip all the junk below here for now until we have time to bring it inline with the new system
|
||||
my $file = _getTemplateFile($self->get("templateId"));
|
||||
my $fileCacheDir = $self->session->config->get("uploadsPath").'/temp/templatecache';
|
||||
my %params = (
|
||||
filename=>$file->getPath,
|
||||
global_vars=>1,
|
||||
loop_context_vars=>1,
|
||||
die_on_bad_params=>0,
|
||||
no_includes=>1,
|
||||
file_cache_dir=>$fileCacheDir,
|
||||
strict=>0
|
||||
);
|
||||
my $error=0;
|
||||
if ($self->session->config->get("templateCacheType") =~ /file/) {
|
||||
eval { mkpath($fileCacheDir) };
|
||||
if($@) {
|
||||
$self->session->errorHandler->error("Could not create dir $fileCacheDir: $@\nTemplate file caching disabled");
|
||||
$error++;
|
||||
}
|
||||
if(not -w $fileCacheDir) {
|
||||
$self->session->errorHandler->error("Directory $fileCacheDir is not writable. Template file caching is disabled");
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if ($self->session->config->get("templateCacheType") eq "file" && not $error) {
|
||||
# disabled until we can figure out what's wrong with it
|
||||
# $params{file_cache} = 1;
|
||||
} elsif ($self->session->config->get("templateCacheType") eq "memory") {
|
||||
$params{cache} = 1;
|
||||
} elsif ($self->session->config->get("templateCacheType") eq "ipc") {
|
||||
$params{shared_cache} = 1;
|
||||
} elsif ($self->session->config->get("templateCacheType") eq "memory-ipc") {
|
||||
$params{double_cache} = 1;
|
||||
} elsif ($self->session->config->get("templateCacheType") eq "memory-file" && not $error) {
|
||||
$params{double_file_cache} = 1;
|
||||
}
|
||||
my $template;
|
||||
unless (-e $file->getPath) {
|
||||
$file->saveFromScalar($self->get("template"));
|
||||
unless (-e $file->getPath) {
|
||||
$self->session->errorHandler->error("Could not create file ".$file->getPath."\nTemplate file caching is disabled");
|
||||
$params{scalarref} = \$template;
|
||||
delete $params{filename};
|
||||
}
|
||||
}
|
||||
return _execute($self->session, \%params,$vars);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 processRaw ( template, vars )
|
||||
|
|
@ -307,7 +249,7 @@ A hash reference containing template variables and loops. Automatically includes
|
|||
|
||||
sub processRaw {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $template = shift;
|
||||
my $vars = shift;
|
||||
return _execute($session, {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ An array of hashes to prepend to the list
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,'Wobject');
|
||||
my %properties;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ text will come out formatted as paragraphs.
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,'Asset_Article');
|
||||
my %properties;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ sub appendPostListTemplateVars {
|
|||
my $page = $p->getPageData;
|
||||
my $i = 0;
|
||||
foreach my $row (@$page) {
|
||||
my $post = WebGUI::Asset->new($row->{assetId}, $row->{className}, $row->{revisionDate});
|
||||
my $post = WebGUI::Asset->new($self->session,$row->{assetId}, $row->{className}, $row->{revisionDate});
|
||||
$post->{_parent} = $self; # caching parent for efficiency
|
||||
my $controls = $self->session->icon->delete('func=delete',$post->get("url"),"Delete").$self->session->icon->edit('func=edit',$post->get("url"));
|
||||
if ($self->get("sortBy") eq "lineage") {
|
||||
|
|
@ -253,7 +253,7 @@ sub decrementThreads {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Collaboration");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ sub canPersonalize {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my %properties;
|
||||
tie %properties, 'Tie::IxHash';
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ sub defaultViewForm {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_DataForm");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_EventsCalendar");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ A hash reference passed in from a subclass definition.
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Folder");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_HttpProxy");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ sub _fetchDepartments {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_InOutBoard");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_IndexedSearch");
|
||||
push (@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ A hash reference passed in from a subclass definition.
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Layout");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Matrix");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_MessageBoard");
|
||||
my %properties;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ defines wobject properties for MultiSearch instances
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session, "Asset_MultiSearch");
|
||||
my $properties = {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Navigation");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ sub _hasVoted {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Poll");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ sub addRevision {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Product");
|
||||
push(@{$definition}, {
|
||||
|
|
@ -813,7 +813,7 @@ sub view {
|
|||
$segment = $self->session->icon->delete('func=deleteAccessoryConfirm&aid='.$id,$self->get("url"),$i18n->get(2))
|
||||
.$self->session->icon->moveUp('func=moveAccessoryUp&aid='.$id,$self->get("url"))
|
||||
.$self->session->icon->moveDown('func=moveAccessoryDown&aid='.$id,$self->get("url"));
|
||||
my $accessory = WebGUI::Asset->newByDynamicClass($id);
|
||||
my $accessory = WebGUI::Asset->newByDynamicClass($self->session,$id);
|
||||
push(@accessoryloop,{
|
||||
"accessory.URL"=>$accessory->getUrl,
|
||||
"accessory.title"=>$accessory->getTitle,
|
||||
|
|
@ -834,7 +834,7 @@ sub view {
|
|||
$segment = $self->session->icon->delete('func=deleteRelatedConfirm&rid='.$id,$self->get("url"),$i18n->get(4))
|
||||
.$self->session->icon->moveUp('func=moveRelatedUp&rid='.$id,$self->get("url"))
|
||||
.$self->session->icon->moveDown('func=moveRelatedDown&rid='.$id,$self->get("url"));
|
||||
my $related = WebGUI::Asset->newByDynamicClass($id);
|
||||
my $related = WebGUI::Asset->newByDynamicClass($self->session,$id);
|
||||
push(@relatedloop,{
|
||||
"relatedproduct.URL"=>$related->getUrl,
|
||||
"relatedproduct.title"=>$related->getTitle,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_SQLReport");
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ defines wobject properties for Stock Data instances
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $properties = {
|
||||
templateId =>{
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ sub completeResponse {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,'Asset_Survey');
|
||||
push(@{$definition}, {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ A hash reference passed in from a subclass definition.
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my %properties;
|
||||
tie %properties, 'Tie::IxHash';
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ sub _create_cache_key {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $httpHeaderFieldType;
|
||||
if ($session->config->get('soapHttpHeaderOverride')) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ defines wobject properties for WeatherData instances
|
|||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session, "Asset_WeatherData");
|
||||
my $properties = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue