cck_map.module causes PHP fatal errors with undefined function leading to blank screen (white screen of death).
1. Line 7 of cck_map.module was the line giving the PHP Fatal Error due to undefined function drupal_get_path.
It is possible the cck_map.module will load before the drupal_get_path function loads and thus an error is caused.
By simply adding a case to test for the presence of the fuction prior to executing line 7 the whole nightmare goes away. And the site pops back up. Theory being, if the function hasn't loaded - you don't need to include it!
2. Also, the argument of the include_once function did not align with other modules' include drupal_get_path statements and appeared to be missing the './'. before the call to drupal_get_path, so I also added the './'. before the call to drupal_get_path and so far so good.
See code below.
Hope this helps!
OLD
function cck_map_init() {
include_once(drupal_get_path('module', 'cck_map') .'/cck_map.inc');
}NEW
function cck_map_init() {
if (function_exists('drupal_get_path')) {
include_once('./'. drupal_get_path('module', 'cck_map') .'/cck_map.inc');
}
}
Comments
Comment #1
beeradb commentedHey all - sorry for the delay in getting back to you on this stuff. I've been rather unresponsive as I have a handful of pressing dealines to hit before christmas. That being said expect to see an update with this and a few other bug fixes sometime this weekend. I'll be sure to post here again when that happens.
Thanks, and sorry again for the delays.
-brad
Comment #2
Toddv commentedThanks for posting this. I installed the module, tested it once, got the fatal error, looked on the forum for a relevant post, found this, and was back and running less than five minutes after first experiencing the problem. Thanks!
-Todd
Comment #3
willzzz commentedI had same problem, but it occurs when cache is activated.
Damz, a very experienced user of french drupal support site www.drupalfr.org, adviced me to move the init function into cck_map_menu and it works.
Comment #4
beeradb commentedA new release is available, and this issue should be resolved. I am closing this issue, but feel free to reopen it if for some reason you continue to experience this issue.
Thanks for the patience in waiting for this latest release, things have moved rather slow with the holidays and all.
Thanks,
Brad
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.