#2494 - config_editor rewrites zone mapping array variables incorrectly
| Identifier | #2494 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | config_editor rewrites zone mapping array variables incorrectly |
| Status | Closed (no changes needed) |
| Handling member | Chris Graham |
| Addon | core_configuration |
| Description | When using config_editor.php, it rewrites zone mapping array variables, such as:
$SITE_INFO['ZONE_MAPPING_zone'] = array('sub.domain.com',''); to: $SITE_INFO['ZONE_MAPPING_zone'][] = 'sub.domain.com'; resulting in errors. |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".
Comments
$SITE_INFO['ZONE_MAPPING_zone'][] = '';
$SITE_INFO['ZONE_MAPPING_zone'][] = 'sub.domain.com';
Which is equivalent.
Maybe you accidentally removed the first line, or assumed it wouldn't work.
The config_editor strictly works on a line-by-line basis, it can't do structure.
(I got the lines the wrong way around in my last reply so I'll clarify in more detail)
I manually added to _config.php:
$SITE_INFO['ZONE_MAPPING_zone'] = array('sub.domain.com','');
I then saved using the config_editor.php script, which rewrote it to:
$SITE_INFO['ZONE_MAPPING_zone'][] = 'sub.domain.com';
$SITE_INFO['ZONE_MAPPING_zone'][] = '';
I then wrote a script to make sure I'm not wrong somehow...
$SITE_INFO=array();
$SITE_INFO['ZONE_MAPPING_zone'][] = 'sub.domain.com';
$SITE_INFO['ZONE_MAPPING_zone'][] = '';
var_dump($SITE_INFO);
$SITE_INFO=array();
$SITE_INFO['ZONE_MAPPING_zone'] = array('sub.domain.com','');
var_dump($SITE_INFO);
Which resulted in the expected output of the same thing twice...
array(1) {
["ZONE_MAPPING_zone"]=>
array(2) {
[0]=>
string(14) "sub.domain.com"
[1]=>
string(0) ""
}
}
array(1) {
["ZONE_MAPPING_zone"]=>
array(2) {
[0]=>
string(14) "sub.domain.com"
[1]=>
string(0) ""
}
}
I also tried saving the config a second time, just to make sure nothing is getting stripped - no problems.