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.
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
Comment #1
febbraro commentedThis was already fixed in CVS, there was just not a release for it. We'll get a release out soon.
Comment #2
febbraro commentedComment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
davidseth commentedYou still have not released a newer version for 5.x yet so this error still appears on some of my sites.
Comment #5
febbraro commentedSorry about that. 5.x - 1.6 should be out now fixing that and few other problems.
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
doublejosh commentedUsed this solution. Triple confirmation that it solves the issue. Believe it was caused when I turned caching on.
Comment #8
doublejosh commentedHowever, 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 18Was 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
Comment #9
febbraro commentedI believe this is actually a 6.x bug.
Comment #10
febbraro commentedMoved the includes in calais_api_init, now committed to CVS. New release due out in about a week.