Skip to content

Commit

Permalink
Item13357: BOOLEAN types are implicitly undefok. Plus fixed some doc.…
Browse files Browse the repository at this point in the history
… Plus fixed load of a Config.spec not terminated by 1; in DEBUG mode. Plus fixed session expiry in an environment where there is no WorkingDir
  • Loading branch information
Comment committed Apr 23, 2015
1 parent c3bd2e2 commit a09e7cb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions core/lib/Foswiki/Configure/Load.pm
Expand Up @@ -193,10 +193,8 @@ sub readConfig {
$validLSC = 0;
}
elsif ( not $return eq '1' ) {
warn
print STDERR
"Running file $file returned unexpected results: $return \n";
$errorMessage =
"Running file $file returned unexpected results: $return";
}
if ($errorMessage) {
die <<GOLLYGOSH;
Expand Down
6 changes: 1 addition & 5 deletions core/lib/Foswiki/Configure/LoadSpec.pm
Expand Up @@ -37,11 +37,7 @@ An *extension* is a pluggable UI extension that supports some extra UI
Each *setting* has a *typespec* and a *def*.
The typespec consists of a type id and some options. Types are loaded by
type id from the Foswiki::Configure::TypeUIs hierachy - for example, type
BOOLEAN is defined by Foswiki::Configure::TypeUIs::BOOLEAN. Each type is a
subclass of Foswiki::Configure::TypeUI - see that class for more details of
what is supported.
The typespec consists of a type id and some options.
A *def* is a specification of a field in the $Foswiki::cfg hash,
together with a perl value for that hash. Each field can have an
Expand Down
4 changes: 3 additions & 1 deletion core/lib/Foswiki/Configure/Wizards/Save.pm
Expand Up @@ -259,7 +259,9 @@ sub save {
if TRACE_SAVE;
eval("\$Foswiki::cfg$k=\$v");
}
elsif ( $spec->CHECK_option('undefok') ) {
elsif ($spec->CHECK_option('undefok')
|| $spec->{typename} eq 'BOOLEAN' )
{
print STDERR "CLEARING $k\n" if TRACE_SAVE;
eval("undef \$Foswiki::cfg$k");
$spec->{saving_value} = undef;
Expand Down
2 changes: 2 additions & 0 deletions core/lib/Foswiki/LoginManager.pm
Expand Up @@ -736,6 +736,8 @@ run from a session or from a cron job.
=cut

sub expireDeadSessions {
return unless $Foswiki::cfg{WorkingDir};

my $time = time() || 0;
my $exp = $Foswiki::cfg{Sessions}{ExpireAfter} || 36000; # 10 hours
$exp = -$exp if $exp < 0;
Expand Down

0 comments on commit a09e7cb

Please sign in to comment.