Item13510: Configure is incorrectly applying $FALSE and $TRUE defaults from Config.spec files

pencil
Priority: Urgent
Current State: Closed
Released In: 2.0.1
Target Release: patch
Applies To: Extension
Component: Configure
Branches: master
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
After installing AntiWikiSpamPlugin, the setting {CheckAttachments} ends up enabled in the configuration.

  • Config.spec value is $Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{CheckAttachments} = $FALSE;
  • Initial install log:
> Installed: 9 files copied; 0 filed checked in, 0 files attached
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{CheckTopics} = undef;
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{CheckAttachments} = undef;
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{CheckRegistrations} = undef;
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{MeaningfulWebs} = '.*';
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{IgnoredTopics} = '^(UserRegistration|WikiUsers|Web.*)$';
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{MeaningfulCount} = 10;
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{ANTISPAMREGEXLISTURL} = 'http://arch.thinkmo.de/cgi-bin/spam-merge';
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{LOCALANTISPAMREGEXLISTTOPIC} = '$Foswiki::cfg{SystemWebName}.AntiWikiSpamLocalList';
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{AutoUpdateSignatures} = undef;
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{GETLISTTIMEOUT} = 60;
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{BypassGroup} = 'AntiWikiSpamBypassGroup';
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{HitThreshold} = 1;
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{RegistrationWhiteList} = '$Foswiki::cfg{SystemWebName}.AntiWikiSpamRegistrationWhiteList';
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{RegistrationBlackList} = '$Foswiki::cfg{SystemWebName}.AntiWikiSpamRegistrationBlackList';
...
New configuration saved in /var/www/data/Foswiki-2.0.0/lib/LocalSite.cfg
| *Key* | *Old* | *New* |
| {Plugins}{AntiWikiSpamPlugin}{ANTISPAMREGEXLISTURL} | ('http://arch.thinkmo.de/cgi-bin/spam-merge') | 'http://arch.thinkmo.de/cgi-bin/spam-merge' |
| {Plugins}{AntiWikiSpamPlugin}{BypassGroup} | ('AntiWikiSpamBypassGroup') | 'AntiWikiSpamBypassGroup' |
| {Plugins}{AntiWikiSpamPlugin}{Enabled} | undef | 1 |
| {Plugins}{AntiWikiSpamPlugin}{GETLISTTIMEOUT} | (60) | '60' |
| {Plugins}{AntiWikiSpamPlugin}{HitThreshold} | (1) | '1' |
| {Plugins}{AntiWikiSpamPlugin}{IgnoredTopics} | ('^(UserRegistration|WikiUsers|Web.*)$') | '^(UserRegistration|WikiUsers|Web.*)$' |
| {Plugins}{AntiWikiSpamPlugin}{LOCALANTISPAMREGEXLISTTOPIC} | ('$Foswiki::cfg{SystemWebName}.AntiWikiSpamLocalList') | '$Foswiki::cfg{SystemWebName}.AntiWikiSpamLocalList' |
| {Plugins}{AntiWikiSpamPlugin}{MeaningfulCount} | (10) | '10' |
| {Plugins}{AntiWikiSpamPlugin}{MeaningfulWebs} | ('.*') | '.*' |
| {Plugins}{AntiWikiSpamPlugin}{Module} | (Foswiki::Plugins::AntiWikiSpamPlugin) | 'Foswiki::Plugins::AntiWikiSpamPlugin' |
| {Plugins}{AntiWikiSpamPlugin}{RegistrationBlackList} | ('$Foswiki::cfg{SystemWebName}.AntiWikiSpamRegistrationBlackList') | '$Foswiki::cfg{SystemWebName}.AntiWikiSpamRegistrationBlackList' |
| {Plugins}{AntiWikiSpamPlugin}{RegistrationWhiteList} | ('$Foswiki::cfg{SystemWebName}.AntiWikiSpamRegistrationWhiteList') | '$Foswiki::cfg{SystemWebName}.AntiWikiSpamRegistrationWhiteList' |
| {Store}{Encoding} | (undef) | 'utf-8' |
  • LocalSite.cfg after installation:
grep AntiWikiSpamPlugin lib/LocalSite.cfg | grep undef
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{AutoUpdateSignatures} = undef;
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{CheckAttachments} = undef;
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{CheckRegistrations} = undef;
$Foswiki::cfg{Plugins}{AntiWikiSpamPlugin}{CheckTopics} = undef;
  • Visit to bin/configure in web:
    • Initially no changes shown in [Save] button
    • Visit the Plugins->AntiWikiSpamPlugin tab, and it immediately jumps to 4 pending changes:
          {Plugins}{AntiWikiSpamPlugin}{CheckTopics}
          {Plugins}{AntiWikiSpamPlugin}{CheckAttachments}
          {Plugins}{AntiWikiSpamPlugin}{CheckRegistrations}
          {Plugins}{AntiWikiSpamPlugin}{AutoUpdateSignatures}
  • Save changes the 4 undefined (default to $FALSE) to true.
    {Plugins}{AntiWikiSpamPlugin}{AutoUpdateSignatures}    ($FALSE)    1
    {Plugins}{AntiWikiSpamPlugin}{CheckAttachments}    ($FALSE)    1
    {Plugins}{AntiWikiSpamPlugin}{CheckRegistrations}    ($TRUE)    1
    {Plugins}{AntiWikiSpamPlugin}{CheckTopics}    ($TRUE)    1

Marking this urgent because applying incorrect defaults during initial installation, and then changing them to other incorrect values via the web interface could cause serious issues.

-- GeorgeClark - 06 Jul 2015 AntiWikiSpamPlugin has had the $FALSE / $TRUE removed. But also recreate with HomePagePlugin. Specifically $Foswiki::cfg{HomePagePlugin}{GotoHomePageOnLogin}
  • Initial configuration is $Foswiki::cfg{HomePagePlugin}{GotoHomePageOnLogin} = 0;
  • Run installer: tools/extension_installer HomePagePlugin install
  • Configuration changed to: $Foswiki::cfg{HomePagePlugin}{GotoHomePageOnLogin} = undef;
  • View configuration with bin/configure: {HomePagePlugin}{GotoHomePageOnLogin}: is checked as enabled, and there is one pending change for save:
  • Save configuration:
{HomePagePlugin}{GotoHomePageOnLogin} ($FALSE) 1

So after an extensions update, the current configuration is changed from 0, to undef, to 1, in sequence.

-- GeorgeClark - 13 Jul 2015

Simple fix. $FALSE and $TRUE need to be defined in Foswiki::Configure::Package

-- GeorgeClark - 16 Jul 2015
 

ItemTemplate edit

Summary Configure is incorrectly applying $FALSE and $TRUE defaults from Config.spec files
ReportedBy GeorgeClark
Codebase 2.0.0
SVN Range
AppliesTo Extension
Component Configure
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:7e1f547ac375
TargetRelease patch
ReleasedIn 2.0.1
CheckinsOnBranches master
trunkCheckins
masterCheckins distro:7e1f547ac375
ItemBranchCheckins
Release01x01Checkins
Topic revision: r5 - 03 Aug 2015, GeorgeClark - This page was cached on 29 Jun 2016 - 09:27.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License