Fatal error: Call to undefined function drupal_get_path() in /home/members/icirr/sites/icirr.org/web/sites/icirr.org/modules/opencalais/arc_rdf/arc_rdf.module on line 52
When I have normal caching enabled, this error occurs when browsing as the anonymous user. Without caching enabled, this does not happen.
I have Localizer module enabled.
This error happens frequently but not every time. Sometimes I can reload a page that loaded fine and get the error.
Needless to say, OpenCalais works fine when I'm logged in or when caching is disabled.
Comments
Comment #1
Anonymous (not verified) commentedAfter poking around in Localizer, I suspect this is a localizer issue instead.
Comment #2
Anonymous (not verified) commentedOk. So I removed localizer entirely from my site, and I still get the error.
That tells me it's not a localizer problem.
I've got a cold, so forgive me for filing the issue if this is a time waster. I probably shouldn't file issues while medicated!
Comment #3
Anonymous (not verified) commentedI found the problem. All implementations of hook_init in the Calais modules call functions that aren't loaded when pages are cached. See #45190: drupal_get_path() call in category_init() fails for cached pages.
I found that content.module's implementation of hook_init wraps code in this condition:
Localizer also checks:
The following Calais hooks will need attention:
calais_api_init
calais_init
arc_rdf_init
I'd submit a patch, but caching and bootstrapping is over my head.
Comment #4
febbraro commentedI see the problem, however, for some reason I have not been able to duplicate it so I wont know if I have fixed it. Do any of you have a quick checklist of steps so that I can reproduce it? Logged in or as anonymous? On view? Calais Tab view? Edit? Save?
Thanks for helping me narrow in on it.
Comment #5
steve hanson commentedI don't know of any predictable way to make this happen - in general, you just let the site aggregate for a while, and then suddenly the site dies.
I have a test site I could run it on to see if it is fixed - is there a version available where you've made the fix?
Comment #6
Anonymous (not verified) commentedThe problem happens when normal caching is enabled. It's an inevitable result of using the drupal_get_path in hook_init without checking first that the function is available. It happens every time you attempt to load a page while not logged in and normal caching is active.
Comment #7
febbraro commentedFix committed to CVS. New release coming soon.
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #9
doublejosh commentedCool, had the same set of issues and traced it to cached content not having access to the drupal_get_path().
Noticed this type of problem has been solved in other modules by placing loading the unit in the menu function... but that appears to only have value because of the if($may_cache) ex... http://drupal.org/node/200395#comment-680563
I tried turning off the three calls to drupal_get_path() in question (arc_rdf.module line 52, calais_api.module line 18, and calais.module line 18) by wrapping them in a test on if($may_cache), but that wasn't enough... I'd need to test for function_exisits(drupal_get_path)... and I don't feel that's exactly protecting the module from caching mode properly.
For now turning off cache until I see a new revision. Let me know if I can help.
I, for one, do need Calais available for unregistered users... for aggregating feeds on cron.
The calais caching issue also lives here: http://drupal.org/node/286750