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

Found a bug? Tell us!!
Post Reply
Tys
Regular
Posts: 36
Joined: Thu Feb 24, 2005 5:18 am

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

Post 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;
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

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

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Tys
Regular
Posts: 36
Joined: Thu Feb 24, 2005 5:18 am

Post 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.
Post Reply