Nov 12th, 2011, 11:46 AM
Hi Grozzy,
From what you described, my hunch is that the necessary Form Tools database settings stored in your /global/config.php file are loaded from within a function/class method call, which only loads them in local scope. So any subsequent Form Tools function calls would attempt to set them as globals, but fail, because they weren't found.This would lead to the problem you mentioned.
Is it just for a form, or are you running Form Tools from within the plugin? If the latter, I'm not too sure of a solution... but for a form, you could try altering your config.php contents to explicitly set them to globals. I'm not positive this would work, but it seems reasonable.
Try changing this:
to this:
Then, whenever the config.php is included *anywhere*, those vars should be set in global scope.
Anyway, give it a go and let me know how it goes.
- Ben
From what you described, my hunch is that the necessary Form Tools database settings stored in your /global/config.php file are loaded from within a function/class method call, which only loads them in local scope. So any subsequent Form Tools function calls would attempt to set them as globals, but fail, because they weren't found.This would lead to the problem you mentioned.
Is it just for a form, or are you running Form Tools from within the plugin? If the latter, I'm not too sure of a solution... but for a form, you could try altering your config.php contents to explicitly set them to globals. I'm not positive this would work, but it seems reasonable.
Try changing this:
Code:
// main program paths - no trailing slashes!
$g_root_url = "...";
$g_root_dir = "..";
// database settings
$g_db_hostname = "...";
$g_db_name = "...";
$g_db_username = "...";
$g_db_password = "...";
$g_table_prefix = "...";
to this:
Code:
// main program paths - no trailing slashes!
$GLOBALS["g_root_url"] = "...";
$GLOBALS["g_root_dir"] = "...";
// database settings
$GLOBALS["g_db_hostname"] = "...";
$GLOBALS["g_db_name"] = "...";
$GLOBALS["g_db_username"] = "...";
$GLOBALS["g_db_password"] = "...";
$GLOBALS["g_table_prefix"] = "...";
Then, whenever the config.php is included *anywhere*, those vars should be set in global scope.
Anyway, give it a go and let me know how it goes.
- Ben