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!

CommentFileSizeAuthor
visibility_api_hook_init.patch768 bytesDavid_Rothstein

Comments

tjholowaychuk’s picture

Status: Needs review » Fixed

Sorry about that! I am aware of that issue but I have a nasty habit of adding js in init(); even today haha

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.