From 560318df51e64333c5fd5889816460ace3c374ad Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 11 Sep 2005 14:37:34 +0000 Subject: [PATCH] Fixed a bug where privileges were not being set correctly on cache files and that was causing write errors. - fix [ 1281437 ] hidden children appear when changing assetsToHide --- docs/changelog/6.x.x.txt | 3 +++ lib/WebGUI/Asset/Wobject/Layout.pm | 2 +- lib/WebGUI/Asset/Wobject/Survey.pm | 2 +- lib/WebGUI/Cache/FileCache.pm | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 0449e1bf6..c49ab1e7b 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -29,6 +29,9 @@ - fix [ 1266159 ] 6.7.1 - getEditForm fields are in funky order - fix [ 1283629 ] Forum bug in 6.5.6 - fix [ 1279887 ] unable to copy Survey Wobject + - Fixed a bug where privileges were not being set correctly on cache files + and that was causing write errors. + - fix [ 1281437 ] hidden children appear when changing assetsToHide 6.7.3 diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm index 8e7501d6f..14dfc3794 100644 --- a/lib/WebGUI/Asset/Wobject/Layout.pm +++ b/lib/WebGUI/Asset/Wobject/Layout.pm @@ -142,7 +142,7 @@ sub view { my %vars; # I'm sure there's a more efficient way to do this. We'll figure it out someday. my @positions = split(/\./,$self->get("contentPositions")); - my @hidden = split("\n",$self->getValue("assetsToHide")); + my @hidden = split("\n",$self->get("assetsToHide")); my $i = 1; my $template= WebGUI::Asset->newByDynamicClass($self->get("templateId"))->get("template"); my $numPositions = 1; diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm index d0ef26d7f..ada4d4e86 100644 --- a/lib/WebGUI/Asset/Wobject/Survey.pm +++ b/lib/WebGUI/Asset/Wobject/Survey.pm @@ -711,7 +711,7 @@ sub view { $var->{'mode.isSurvey'} = ($self->get("mode") eq "survey"); $var->{'survey.noprivs.label'} = WebGUI::International::get(48,'Asset_Survey'); $var->{'quiz.noprivs.label'} = WebGUI::International::get(49,'Asset_Survey'); - return $self->processTemplate($var, $self->getValue("templateId")); + return $self->processTemplate($var, $self->get("templateId")); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Cache/FileCache.pm b/lib/WebGUI/Cache/FileCache.pm index 688e9c4cd..470f736ac 100644 --- a/lib/WebGUI/Cache/FileCache.pm +++ b/lib/WebGUI/Cache/FileCache.pm @@ -230,12 +230,11 @@ sub set { my $self = shift; my $content = shift; my $ttl = shift || 60; + my $oldumask = umask(); + umask(0000); my $path = $self->getFolder(); unless (-e $path) { - my $oldumask = umask(); - umask(0000); eval {mkpath($path,0)}; - umask($oldumask); if ($@) { WebGUI::ErrorHandler::error("Couldn't create cache folder: ".$path." : ".$@); return; @@ -251,6 +250,7 @@ sub set { open(FILE,">".$path."/expires"); print FILE time()+$ttl; close(FILE); + umask($oldumask); }