Page 1 of 1

How to add Complex configuration options

Posted: 12 May 2009, 21:56
by peterus
As noted by previous posters there seems to be issues with complex types being added as strings.

I've found a way around this. First define the type and use serialize to turn it into a string.
Add the value as a string in mantis. Then in the database change the type from 2 to 3 (complex).

e.g.

Code: Select all

<?PHP

$status = array (
	10 => "New",
	20 => "Client to Provide More Information",
	30 => "Support Investigating",
	35 => "Further Investigation",
	40 => "Escalated to Development",
	45 => "Fixed in Release",
	80 => "Client to Test/Confirm",
	90 => "Closed"
);

$str = serialize($status);
print $str . "\n";

?>
Output is

Code: Select all

a:8:{i:10;s:3:"New";i:20;s:34:"Client to Provide More Information";i:30;s:21:"Support Investigating";i:35;s:21:"Further Investigation";i:40;s:24:"Escalated to Development";i:45;s:16:"Fixed in Release";i:80;s:22:"Client to Test/Confirm";i:90;s:6:"Closed";}
Then in your database
SELECT * FROM mantis_config_table;
Change the type from 2 (string) to 3 (complex)

Mantis Configuration Support now displays the value correctly.

I hope this helps as I was messing around with this for ages.

Cheers,
Peterus

Re: How to add Complex configuration options

Posted: 13 May 2009, 08:56
by Buga
you can define the type while adding a new option. does this not work for you?
I never had such problems

Re: How to add Complex configuration options

Posted: 05 Jun 2009, 09:09
by abdaizs
I had this problem too and I change the values in database too, and it works.
You can modify it by configuration administration form, but in the database there will be put by Value 2.

Re: How to add Complex configuration options

Posted: 14 Jul 2009, 09:48
by jackthomas
hi abdaizs... its working man thanks for your info... thanks a lot.....

take care.....



document scanning