Fatal error: Call to undefined function language_initialize()
PlayfulWolf - August 5, 2008 - 19:47
| Project: | Click HeatMap |
| Version: | 6.x-2.5 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Hi,
After extracting library into module directory and doing everything exactly as specified in readme file got:
Fatal error: Call to undefined function language_initialize() in C:\wamp\www\d6test1\sites\all\modules\click_heatmap\click_heatmap.module on line 149
Drupal 6.3, Click Heatmap 2.5
Windows XP, wamp

#1
sorry :) commented out that function.
#2
So is there still a bug?
#3
This is still a bug. The attached patch fixes the problem (and removes some trailing whitespace).
AFAICT the problem is that in click_heatmap_remove_language_prefix() we're tryingto call the function language_initialize() which may not be available.
Looking through drupal_init_language() in bootstrap.inc, language.inc is only included if the site uses two or more languages.
The fix in this patch simply includes language.inc in click_heatmap_remove_language_prefix().
#4
This is definitely a bug for sites only using one language.
I have done what I think is a cleaner fix to just check the number of languages, no need to do anything in the function click_heatmap_remove_language_prefix() if there is only the one language in use (and I've left the whitespace fixes from the previous patch)
#5
Committed.
Thanks.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.