How to add Complex configuration options

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
peterus
Posts: 5
Joined: 12 May 2009, 16:20

How to add Complex configuration options

Post 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
Buga
Posts: 74
Joined: 31 Mar 2008, 12:10

Re: How to add Complex configuration options

Post by Buga »

you can define the type while adding a new option. does this not work for you?
I never had such problems
abdaizs
Posts: 13
Joined: 10 Mar 2008, 08:32

Re: How to add Complex configuration options

Post 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.
jackthomas
Posts: 1
Joined: 14 Jul 2009, 09:20

Re: How to add Complex configuration options

Post by jackthomas »

hi abdaizs... its working man thanks for your info... thanks a lot.....

take care.....



document scanning
Post Reply