Item9435: the TOPICVALIDATION_PLUGIN_RULESET variable don't work

pencil
Priority: Normal
Current State: New
Released In:
Target Release: n/a
Applies To: Extension
Component: TopicNameValidationPlugin
Branches:
Reported By: JuanPabloGaviria
Waiting For:
Last Change By: JuanPabloGaviria
Hi,

I trying to use this plugin but when i set the TOPICVALIDATION_PLUGIN_RULESET nothing happens, but if i unset that variable and play with the default rules in the default topic rules System.TopicNameValidationPlugin works ok.

So, i checked the code and i found that when that varible is set the plugin stop working because never get the varibles value only check that the variable are set with Foswiki::Func::getPreferencesFlag function never use Foswiki::Func::getPreferencesValue. I make the patch:

diff TopicNameValidationPlugin.pm.bad TopicNameValidationPlugin.pm
64,66c64,69
<   my $ruleSetTopics = Foswiki::Func::getPreferencesFlag("TOPICVALIDATION_PLUGIN_RULESET") 
<     || "$systemWeb.TopicNameValidationPlugin, System.TopicNameValidationPlugin";
< 
---
>   my $ruleSetTopicsFlag = Foswiki::Func::getPreferencesFlag("TOPICVALIDATION_PLUGIN_RULESET") || '0';
>   my $ruleSetTopics = "$systemWeb.TopicNameValidationPlugin, System.TopicNameValidationPlugin";
>   if ($ruleSetTopicsFlag != '0'){
>     $ruleSetTopics = Foswiki::Func::getPreferencesValue("TOPICVALIDATION_PLUGIN_RULESET");
>   }
>   Foswiki::Func::writeDebug('rules: ' . $ruleSetTopics);
109c112
< 
---
>     Foswiki::Func::writeDebug('patron: ' . $pattern);

If you have a better solution pleace post it. In this patch i wirte some debug lines just ignore it.

-- JuanPabloGaviria - 04 Aug 2010

 

ItemTemplate edit

Summary the TOPICVALIDATION_PLUGIN_RULESET variable don't work
ReportedBy JuanPabloGaviria
Codebase 1.0.9
SVN Range
AppliesTo Extension
Component TopicNameValidationPlugin
Priority Normal
CurrentState New
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r1 - 04 Aug 2010, JuanPabloGaviria
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy