Fatal error: Call to undefined function drupal_get_path() in /srv/www/barnehage.chrissearle.net/htdocs/sites/all/modules/calendar/calendar.module on line 9

Been getting this after updating 1.5 to 1.6 (upgrade.php has been run if that makes a difference).

Only for the anonymous user. Trouble is - it also affects the login form - so I can only work on a browser where I have a cookie already.

I suspect from googling that it may be to do with access control.

If I enable Access All Views for anonymous then the problem goes away.

Comments

chrissearle’s picture

Rewind - no - the access all views does not help. Must have been a cached page.

chrissearle’s picture

Interesting.

If I truncate all the cache tables I can display the home page exactly once as anonymous - then it goes back to the error.

Further digging - its the cache_page table that I need to empty. If this is empty - then anonymous can show the page. One hit as anonymous and I get the error.

The table after one hit contains two rows, one for the home page (data is a blob, expire is -1, created is the correct timestamp and headers of Content-Type: text/html; charset=utf-8). The other is for /favicon.ico (data is a blob, expire is -1, created is the correct timestamp and headers of Content-Type: text/html; charset=utf-8 HTTP/1.1 404 Not Found).

I have no idea what is in the blob, nor why this then causes the error in calendar.

However - by changing the cache from normal to off I lose the problem. I know it says that calendar does not support aggressive - but I had not chosen that :) I can work with it off for now - but - if anyone can give me a hint as to what is going on I'd appreciate it.

KarenS’s picture

Status: Active » Fixed

I just made a commit to get rid of the CALENDAR_PATH constant since it seems to bite me wherever I put it. See if the very latest code (as of just a minute ago) fixes your problem and reopen if not.

adrinux’s picture

I ran into this too, and yep, the latest code in CVS doesn't have this problem. (Views arguments were missing, but that was cured by clearing the views cache.)

Confirmed fixed.

VValdo’s picture

I'd like to confirm this bug as well. I can't find anything in CVS at http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/calendar/ (blank page) - was looking for a recent checkin but see nothing.

Will this be fixed in a 1.7? For now I've just turned off the view causing the problem.

Thx!

VValdo’s picture

FWIW, turning off caching fixed this temporarily. Turning off the block did NOT.

W

Mike_M’s picture

Just replace "CALENDAR_PATH" to "drupal_get_path('module', 'calendar')" in calendar.module and delete line "define('CALENDAR_PATH', './'. drupal_get_path('module', 'calendar'));".

This fix should work.

Anonymous’s picture

Status: Fixed » Closed (fixed)