How to add Complex configuration options
Posted: 12 May 2009, 21:56
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.
Output is
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
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";
?>
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";}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