I'm getting occasional errors like this:

Fatal error: Call to undefined function: node_load() in <path>modules/og/og.module on line 206

in a 4.6 install. My assumption is that it's because I've got caching turned on (why else wouldn't node_load exist?), and I've turned it off for now and it seems to have fixed it. Of course, caching would be nice ...

So - can I solve this by clearing my cache? Or is this an error in handling cached pages? Meanwhile I'm going to try and understand the code a bit more to see if I can just wrap a 'function_exists' around the offending code ...

Comments

adixon’s picture

Status: Active » Needs review

okay, i think this patch should work, but someone should look first:

Index: og.module
===================================================================
--- og.module   (revision 343)
+++ og.module   (working copy)
@@ -86,7 +86,7 @@

 function og_init() {
   // only bother when we are not serving a cached page. check for which functon that only exists afterwards
-  if (function_exists('module_init')) {
+  if (function_exists('module_init') && function_exists('node_load')) {
      og_theme();
    }
 }

In other words, it looks like the existence of module_init isn't a reliable indicator of whether i'm serving a cached page. Obviously, node_load is, though perhaps there's a more standard way to do this.

Jhef.Vicedo’s picture

I think the content of og_init() hook should be placed on hook_menu(!$may_cache).
See http://api.drupal.org/api/4.6/function/hook_init

adixon’s picture

Yes, that issue is being dealt with here: http://drupal.org/node/66155

moshe weitzman’s picture

Status: Needs review » Closed (fixed)

too old version