there is a bug, still existing in 2.6.1, saving changes in configuration.
If u want to uncheck any checked checkbox in configarea and save it, it will still shown as checked. This is caused by a not working hack in file admin/configuration.php (line 54 ff)
Code: Select all
// Hacks
if (is_array($editData['edit'])) {
foreach ($newConfigValues as $key => $value) {
// Fix checkbox values: they are not returned as HTTP POST values...
if (!array_key_exists($key, $editData['edit'])) {
$newConfigValues[$key] = 'false';
}
}
}
$faqconfig->update($newConfigValues);
Here's the fix, just replace the old code with the new one.
Code: Select all
// new empty checkbox hack by Ortwin Pinke <www.dceonline.de>
$editData['neededCheckboxes'] = array( 'main.languageDetection',
'main.disableAttachments',
'main.enableAdminLog',
'main.ipCheck',
'main.ldapSupport',
'main.enableRewriteRules',
'main.enableUserTracking',
'main.enableWysiwygEditor',
'main.enableUpdate',
'main.useSslForLogins',
'main.enableAttachmentEncryption',
'main.optionalMailAddress',
'main.useAjaxSearchOnStartpage',
'records.enableVisibilityQuestions',
'records.defaultActivation',
'records.defaultAllowComments',
'spam.checkBannedWords',
'spam.enableCaptchaCode',
'spam.enableSafeEmail'
);
foreach($editData['neededCheckboxes'] as $value) {
if(!array_key_exists($value, $newConfigValues)) {
$newConfigValues[$value] = "false";
}
}
/*
// you may remove this debugging stuff if not needed any more
echo "<pre>";
print_r($editData['edit']);
print_r($newConfigValues);
echo "</pre>";
*/
$faqconfig->update($newConfigValues);
Maybe someone finds a better solution.
My first idea, reading fields out of db-conf-table, isn't useable cause of missing boolean type in db for needed checkboxfields.
Regards Ortwin