blank site -- db_prefix bug
phildu - August 30, 2007 - 04:36
| Project: | footermap: a footer site map |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | mradcliffe |
| Status: | closed |
Description
each time i try to install it my site become .. blank ??
nothing in the source code to ??

#1
Hmm, I just re-installed the module on my 5.x test site.
Do you have access to your httpd server error log, and could you print any message it prints out relating to footermap?
Just to clarify, the blank page doesn't happen until after you check the box and install the module correct? It doesn't happen when you're just going to your admin page?
#2
it happens when i validate the form of "modulle install " module
#3
What is displayed in the httpd error log?
My guess is either a php error or a php memory timeout. Do you have many modules installed?
#4
don't where i can find httpd log error ?
and i have... moderate number of module
i have add others modules after
maybe my theme ?
#5
The server error logs may be anywhere. Is your web site on a "virtual hosting" service or a "dedicated server"?
Perhaps they are in /etc/httpd/log. You may not have access to this directory on your server. Your hosting company may have server error logs usually on their web control panel (cpanel?).
#6
Also drupal's watchdog module may display the server error messages.
admin/logs/watchdog.
#7
Closing.
#8
I have the same issue. Absolutely blank site. tried with different themes. pretty bad because i had to go in and modify system database and deactivate the module to recover.
got this error:
call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'footermap_settings' was given in /home/yo/public_html/drupal/includes/form.inc on line 218.
drupal 5.6
#9
That's odd, I went and double-checked the latest version on a drupal-5 test site, and I wasn't able to find the changes (this is also essentially the same code as in drupal-6). I played around a bit. When I changed the footermap_settings() function name to say footermap_aseuthaesuthausth_settings() without modifying the appropriate callback hash key in hook_menu I received this error.
I wonder if the version of footermap you have has 'function footermap_settings()' defined?
In any case if you have shell access please download this attachment into the footermap/ module directory, and run the following command:
patch -p0 < footermap-5.x-settings-hook.patchSomething else I would try is to remove the footermap/ directory and download a fresh copy from drupal.org if that patch fails or you cannot patch.
#10
thanks - but which version are you referring to?
#11
I'm running drupal-5.7 on my test site.
#12
I had some trouble with the patch - has anyone else experienced this and had it resolved by this patch? Are there any other modules that can act as alternative to using a menu as a footer?
thanks,
S.
#13
Ya, I just added the module and my site went completely blank. I removed the /modules/footermap/ folder and the site came back. I tried to extract the files again and the site just disappeared again without enabling the module. I've removed the directory again, but please tell me what database entries I need to remove? I cannot risk any problems at this point... please help.
#14
From the attached screenshot, I think it's because I gave my drupal database a 'prefix' of 'd_' so everything is 'd_menu' rather tan 'menu' and it looks like the database calls are hard coded to 'menu'
I will attempt to fix this myself... but this should be updated.
#15
This only happens if you gave your database a 'prefix':
1) If you haven't already enabled the module, do so (Your site will or is blank now).
2) If you already enabled the module and deleted the directory to get your site to come back up, re-download the files and unzip them to the footermap/ directory.
3) Download footermap.module to your computers hard drive or edit it via any software.
4) Update the 'footermap_get_menu' function in 'footermap.module'
OLD FUNCTION:
/*
* Retrieve menu recursively
* @param mid menu_id
* @param level what level we are in the tree
* @param hastree has sub menus
* @param temp reference to a string to output
* @return boolean a boolean to tell whether or not to carraige return
*/
function footermap_get_menu($mid,$arrcnt,$level,&$mapref,$limit)
{
$x = 0;
$a = 0;
if( ($limit != 0 ) && ($level > $limit) )
return 0;
if( $paths )
$r = db_query("SELECT menu.*, (SELECT dst FROM url_alias WHERE src = menu.path) AS alias FROM menu WHERE pid = $mid ORDER BY pid,weight")
or die(db_error());
else
$r = db_query("SELECT * FROM menu WHERE pid = $mid ORDER BY pid,weight")
or die(db_error());
while( $h = db_fetch_object($r) )
{
unset($cur); // let's make sure we unset things first
$cur = 'menu' . $h->mid;
if ( dechex($h->type) %10 != 0 )
{
if ( $h->path != '' )
$a = 1;
else if ( (variable_get('menu_headers',0) == 1) && ($h->path == '') )
$a = 1;
else
$a = 2;
}
else
$a = 0;
if( $a > 0 )
{
if ( $a == 1 ) // menu_headers enabled
{
if ( $h->alias )
$mapref[$arrcnt][$cur][href] = $h->alias;
else
$mapref[$arrcnt][$cur][href] = $h->path;
if ( $h->path == "/" )
$mapref[$arrcnt][$cur][href] = $base_url;
$mapref[$arrcnt][$cur][title] = $h->title;
}
$x = 1;
$hastree = footermap_get_menu($h->mid,$arrcnt,($level+1),$mapref,$limit);
if ( $level == 1 && $hastree == 1)
$arrcnt++;
}
}
return $x;
} // function footermap_get_menu()
NEW FUNCTION: (My prefix is 'd_' as you can see below, I changed 'menu' to 'd_menu' in 4 places)
/*
* Retrieve menu recursively
* @param mid menu_id
* @param level what level we are in the tree
* @param hastree has sub menus
* @param temp reference to a string to output
* @return boolean a boolean to tell whether or not to carraige return
*/
function footermap_get_menu($mid,$arrcnt,$level,&$mapref,$limit)
{
$x = 0;
$a = 0;
if( ($limit != 0 ) && ($level > $limit) )
return 0;
if( $paths )
$r = db_query("SELECT d_menu.*, (SELECT dst FROM url_alias WHERE src = d_menu.path) AS alias FROM menu WHERE pid = $mid ORDER BY pid,weight")
or die(db_error());
else
$r = db_query("SELECT * FROM d_menu WHERE pid = $mid ORDER BY pid,weight")
or die(db_error());
while( $h = db_fetch_object($r) )
{
unset($cur); // let's make sure we unset things first
$cur = 'd_menu' . $h->mid;
if ( dechex($h->type) %10 != 0 )
{
if ( $h->path != '' )
$a = 1;
else if ( (variable_get('menu_headers',0) == 1) && ($h->path == '') )
$a = 1;
else
$a = 2;
}
else
$a = 0;
if( $a > 0 )
{
if ( $a == 1 ) // menu_headers enabled
{
if ( $h->alias )
$mapref[$arrcnt][$cur][href] = $h->alias;
else
$mapref[$arrcnt][$cur][href] = $h->path;
if ( $h->path == "/" )
$mapref[$arrcnt][$cur][href] = $base_url;
$mapref[$arrcnt][$cur][title] = $h->title;
}
$x = 1;
$hastree = footermap_get_menu($h->mid,$arrcnt,($level+1),$mapref,$limit);
if ( $level == 1 && $hastree == 1)
$arrcnt++;
}
}
return $x;
} // function footermap_get_menu()
5) Save, Re-upload, and overwrite the old file. The module now works.
#16
Simpler fix, which was in the drupal-6.x version. The table names need to be enclosed in { }.
CVS Diff.
Can you download the development snapshot and review? The dev. snapshot should be updated in about 4 hours or 16 hours. Or you can apply the patch above.
EDIT: I made ported some changes from drupal-6 to drupal-5 version of this module. If you want to just test the patch, then please us the "CVS Diff" link above.
#17
I've recently installed this module today and immediately was given a blank page, using Drupal 6.2 and footermap 6.x-1.3, upon clicking the install module button everything just went blank. Looking through the footermap.module file I've noticed the db titles were already incased with { }, then I attempted to delete the old files and use the 6.x-1.x-dev files instead only to find that there was an error on line 100 stating there was an ; in place of a , and I made those changes myself and refreshed and still continue to have a blank page.
This was the only module I recently installed, have the latest Drupal, and yes I do have a table prefix at "drupal_" for the database.
Any ideas?
#18
It would be great if you had access to any http server logs right after the incident. Like
tail -v /path/to/my/error_log.What other modules are you using? The WSOD usually occurs with a php error of some kind, which may be the result of php.ini, a bug in the module itself, or some inconsistency between modules.
Does the WSOD only appear on the admin/build/modules page?
Thank you for the report on the 6.x-dev version.
#19
I just installed version 6.x-1.x with Drupal version 6.1 and got the blank site problem. I checked the error log and there were no new error messages from today.
I removed the footermap directory to get my site back up. When I came back to the site, I saw this message:
user warning: Unknown table 'menu_links' query: SELECT menu_links.*, coalesce(node.status,1) as nstatus FROM sitecontent_menu_links LEFT OUTER JOIN sitecontent_node ON substr(menu_links.link_path,6) = node.nid WHERE plid = 0 AND module <> 'system' AND hidden <> -1 ORDER BY plid,weight in /home/nyscasa/public_html/sites/all/modules/footermap/footermap.module on line 180.
#20
I see. There is a bug. Please test the dev version when it updates tomorrow (should update in a few hours).
retrieving revision 1.11.2.15diff -r1.11.2.15 footermap.module
177c177
< $r = db_query("SELECT menu_links.*, coalesce(node.status,1) as nstatus, (SELECT dst FROM {url_alias} WHERE src = menu_links.link_path) AS alias FROM {menu_links} LEFT OUTER JOIN {node} ON substr(menu_links.link_path,6) = node.nid WHERE plid = %d AND module <> 'system' AND hidden <> -1 ORDER BY plid,weight",$mlid)
---
> $r = db_query("SELECT ml.*, coalesce(n.status,1) as nstatus, (SELECT ul.dst FROM {url_alias} ul WHERE src = ml.link_path) AS alias FROM {menu_links} ml LEFT OUTER JOIN {node} n ON substr(ml.link_path,6) = n.nid WHERE ml.plid = %d AND ml.module <> 'system' AND ml.hidden <> -1 ORDER BY ml.plid,ml.weight",$mlid)
180c180
< $r = db_query("SELECT menu_links.*, coalesce(node.status,1) as nstatus FROM {menu_links} LEFT OUTER JOIN {node} ON substr(menu_links.link_path,6) = node.nid WHERE plid = %d AND module <> 'system' AND hidden <> -1 ORDER BY plid,weight", $mlid)
---
> $r = db_query("SELECT ml.*, coalesce(n.status,1) as nstatus FROM {menu_links} ml LEFT OUTER JOIN {node} n ON substr(ml.link_path,6) = n.nid WHERE ml.plid = %d AND ml.module <> 'system' AND ml.hidden <> -1 ORDER BY ml.plid,ml.weight", $mlid)
#21