In the latest CivicSpace release (0.8.5) and attempting to use the massmailer module, I am getting the same old error:
"The database configuration information could not be loaded from the drupal configuration file: default/settings.php"
I have read dozens of postings where others have had this problem, too and have attempted various fixes. None have worked for me. Most fixes seem to center around the idea that the module cannot find the conf.php file. However, the error displayed in the browser comes directly from a die command in that file. So, the file must be running. A little investigation and it seems the problem may actually be in this function:
function drupal_conf_init() {
$args = parseCline();
$uri = $args['d'];
$site = strtolower(strtr($args['h'] . substr($uri, 0, strrpos($uri, '/')), '/:', '..'));
while (strlen($site) > 4) {
if (file_exists('../../../../../../sites/'. $site .'/settings.php')) {
return $site;
}
else {
$site = substr($site, strpos($site, '.') + 1);
}
}
return 'default';
}
Now, I haven't done any coding since back in my college days, so it's been quite a while, but what is the point of calling the else{} statement if it is going to return 'default' when it fails the if{}? Shouldn't it return the site name converted into the dot delineated folder name where the current site's settings.php file is located. That is, after all, the file it is looking for. Is it not? I.e., the function should be returning something like, 'www.mysite.com.subdirectory' and the calling function will then prepend that onto the file name it is trying to find. So, 'sites/www.mysite.com.subdirectory/settings.php'.
I have multiple sites running on a single installation, and each site's settings.php file is in a dot delineated folder, but this function cannot parse the URL correctly and find the folder. Why not?
Oh yeah, and what is parseCline()? Is that a core PHP function or what?
I know if I hardcode the correct site folder into the return command, the mailer will work. Otherwise, no go.
Happy Trails,
BC
Comments
Closer look...
OK, on a closer look, I see that the else {} statement is within a while loop. Got it! But the entire function is still failing and returning 'default'. What could cause that?
I thought it might not be finding ParseCline() so added a die statement after it like this:
Well, it died. So I copied the PaseCline function from the phplist/admin/index.php file and pasted it in just above the drupal_config_init function. Then I got a blank screen when sending mail. The source of the output page showed
<? USING ../../config.php>The mailer works fine if I hardcode the site folder into the return line, but I need this to work on a multi-site installation.
Every fix I have run across either does not work, or is just downright wrong!
Any ideas.
BC