Item9435: the TOPICVALIDATION_PLUGIN_RULESET variable don't work
Priority: Normal
Current State: New
Released In:
Target Release: n/a
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