The following error brought down my site:

Fatal error: Call to undefined function drupal_get_path() in /var/www/vhosts/{website}/httpdocs/sites/all/modules/opencalais/arc_rdf/arc_rdf.module on line 52

Upon investigation, I found content blocker had the same problem last year.

http://drupal.org/node/157157

There solution was to add an if condition around the offending function.

Line 52 of arc_rdf.module

function arc_rdf_init() {
+ if (function_exists('drupal_get_path')) {
$path = realpath(drupal_get_path('module', 'arc_rdf'));
define('RDF_ARC2_PATH', $path .'/arc2');
define('RDF_FORMAT', variable_get('rdf_format', 'rdf+json'));
define('RDF_SITE_URI', url(NULL, array('absolute' => TRUE)));

if (!class_exists('ARC2') && file_exists(RDF_ARC2_PATH . '/ARC2.php')) {
require_once RDF_ARC2_PATH .'/ARC2.php';
}
+ }
}

Line 17 of calais_api.module

function calais_api_init() {
+ if (function_exists('drupal_get_path')) {
$modulepath = drupal_get_path('module', 'calais');
require_once ("$modulepath/calais.test.inc");
+ }
}

That did the trick for me. Great tool by the way.

Comments

febbraro’s picture

Assigned: Unassigned » febbraro

This was already fixed in CVS, there was just not a release for it. We'll get a release out soon.

febbraro’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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

davidseth’s picture

Status: Closed (fixed) » Active

You still have not released a newer version for 5.x yet so this error still appears on some of my sites.

febbraro’s picture

Status: Active » Fixed

Sorry about that. 5.x - 1.6 should be out now fixing that and few other problems.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

doublejosh’s picture

Used this solution. Triple confirmation that it solves the issue. Believe it was caused when I turned caching on.

doublejosh’s picture

Status: Closed (fixed) » Active

However, now I have a similar issue on...

Fatal error: Call to undefined function drupal_get_path() in /home/ihsea/public_html/sites/all/modules/opencalais/calais_api.module on line 18

Was about to throw a test around line 18, but the whole purpose of the calais_api_init() function is to load the API... or is it a test?

Suppose we need to shut down the module on cached pages. So perhaps doing that test is the right move.

However 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/270391

febbraro’s picture

Version: 5.x-1.5 » 6.x-2.2

I believe this is actually a 6.x bug.

febbraro’s picture

Status: Active » Fixed

Moved the includes in calais_api_init, now committed to CVS. New release due out in about a week.

Status: Fixed » Closed (fixed)

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