Recent Topics

1 Apr 22, 2006 05:17    

Hey, i'm trying to retrieve one of the settings in my plugin and i'm getting this;

Fatal error: Call to a member function on a non-object in D:\Work\Site\b2evolution\blogs\plugins\lightality_plugin\_lightality.plugin.php on line 99

Line 99 is;

if( $this->UserSettings->get('AntiSpamOption') == 'NoWebsite' )

Here is my GetDefaultSettings function if it helps;

function GetDefaultSettings()
{
$Settings = array(
'AntiSpamOption' => array(
'label' => T_('AntiSpam Option'),
'note' => T_('Which method of antispam protection would you like to enable?'),
'type' => 'select',
'defaultvalue' => 'None',
'options' => array( 'None' => T_('None'), 'NoWebsite' => T_('No Website') ),
),
);

return $Settings;
}

Can anyone help with this?
-balupton

2 Apr 22, 2006 05:34

UserSettings get instantiated from the data provided by GetDefaultUserSettings(), not GetDefaultSettings() (which provides the meta data for Settings).

Simple, but I'll look into documenting it better.. :)

3 Apr 22, 2006 05:37

Arrrgh.... i thought about that, maybe im using the wrong settings thing, but i was sure i wasnt so i didnt look :(

Thanks ;)

4 Apr 22, 2006 05:48

Welcome.

I haven't looked close at your mail also at first, but just deleted the mail about do-not-use-it-in-the-constructor et al.. :)

5 Apr 22, 2006 05:55

Allright i really didn't follow that post ;)


Form is loading...