Hello,
sorry to bring this thread back to the top, but I have a little problem with a module.
I have some forms on a module page, one of them is updateing the
modx_system_settings DB table. Everything works fine, but after the update, the value is not always available.
The value is from
$modx->config[’mysetting’]
I know I could write a little PHP function to always query the DB, but I’d like to use the MODx API. After the DB update, I’m also updateing the value of
$modx->config[’mysetting’] with this (but with no luck):
<?php
$result = $modx->db->select('setting_value', $modx->getFullTableName('system_settings'), " setting_name = 'mysetting'");
if ($result)
$modx->config['mysetting'] = $modx->db->getValue($result);
?>
The forms are basic HTML forms, no data is submitted with Javascrip because I like to keep the scripts as clean as possible. From xwisdom’s post, I understood this could be fixed with following Javascript function:
<script language="JavaScript" type="text/javascript">
function postForm(opcode){
document.module.opcode.value=opcode;
document.module.submit();
}
</script>
My questions is, can it be done without it? Maybe force the API to update the settings values?
Thank you!
Boby