Page 1 of 1

Using $this->get_config() in configuration seg faults apa

Posted: Sun Mar 20, 2005 11:56 pm
by Tys
In my installation, $this->get_config('key') with no default set (or if the default is set to NULL) seg faults apache when used in the function introspect_config_item($name, &$propbag).

Example:

Code: Select all

			case 'secret_key':
				$propbag->add('type',        'string');
                $propbag->add('name',        PLUGIN_SIDEBAR_MOTM_KEY);
				$secret_key = $this->get_config('secret_key');
				if (!$secret_key)
					$secret_key = PLUGIN_SIDEBAR_MOTM_KEY_KEY;
                $propbag->add('description', sprintf(PLUGIN_SIDEBAR_MOTM_KEY_DESC,$serendipity['baseURL'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '') . 'plugin/motm-update&track=%t&artist=%a&album=%b&genre=%g&tracktime=%y&secret_key=' . $secret_key));
                $propbag->add('default',     '');
				break;

Re: Using $this->get_config() in configuration seg faults

Posted: Mon Mar 21, 2005 10:52 am
by garvinhicking
I think you cannot access the get_config within the introspection function, that leads to an endless loop because the introspection functions returns preparses the configuration value array.

So you'll need to develop a way around it to later get the config value of something...

Regards,
Garvin

Posted: Mon Mar 21, 2005 6:41 pm
by Tys
It seems to work when I use a default for some reason. Was a definately weird bug to debug as it crashed before it even outputted the statement above it, guess cause output was buffered.