Fatal error: Call to undefined function drupal_get_path() in /var/www/modules/accessibility/accessibility.module on line 26

Is there a fix for this?

I'm using the latest verison accessibility-5.x-1.x-dev.tar.gz and have made the modification to common.inc

Comments

jabba_29’s picture

Assigned: Unassigned » jabba_29

Can you please give more info as to what version of Drupal you are using,
OS system etc, other modules, modifications you have made yourself ...

The solution / quick fix I posted on skiffie was a follows.
However, I am unable to reproduce this error in the sites I have installed this mod on..
_________________________________________________

The changes to common.inc have no bearing on this at all.

The line in the module file is when the module calls a file for inclusion.

If you know the actual path to this file you can remove the function and use the actual path, or as an alternative try writing your own...

if (!function_exists("drupal_get_path")) {
	function drupal_get_path($type, $name) {
  	return dirname(drupal_get_filename($type, $name));
	}
}

Also search this site for this error message.

jabba_29’s picture

Status: Active » Closed (fixed)

Can't reproduce.

jabba_29’s picture

Try changing line 26 in accessibility.module to:

include_once dirname(__FILE__) . '/accessibility.php';

oguillaume’s picture

The page caching mode option in the performance module can cause this problem with the accessibility module as documented in the performance administration page :

The following enabled modules are incompatible with aggressive mode caching and might not function properly: accessibility, content, statistics, throttle

I tried to use the Normal (recommended, no side effects) and it caused my Drupal side to fail with error message similar to :

Call to undefined function drupal_get_path() 
[..]  
 /accessibility.module on line 26

To fix this, go to your website
Go to ?q=admin/settings/performance and disable caching mode (or try to do without the accessibility module).