Closed (fixed)
Project:
Visibility API
Version:
5.x-1.2-1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Feb 2008 at 20:25 UTC
Updated:
12 Mar 2008 at 01:11 UTC
I'm using Visibility API with caching enabled (normal caching, not aggressive). I found that whenever you log out and visit a cached page, you get a white screen of death with this error message:
Fatal error: Call to undefined function drupal_add_js() in /web/sites/all/modules/visibility_api/visibility_api.module on line 13
The problem is that in Drupal 5, drupal_add_js() should not be called in hook_init() since this function is not available on cached pages. See http://api.drupal.org/api/function/hook_init/5.
Here is a patch that fixes this by moving the code to hook_menu(), as suggested on that page. You may want to try a different solution instead, but this fixes the bug.
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| visibility_api_hook_init.patch | 768 bytes | David_Rothstein |
Comments
Comment #1
tjholowaychuk commentedSorry about that! I am aware of that issue but I have a nasty habit of adding js in init(); even today haha
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.