=== modified file 'includes/path.inc' --- includes/path.inc 2009-01-04 20:04:32 +0000 +++ includes/path.inc 2009-02-21 17:11:20 +0000 @@ -46,13 +46,15 @@ function drupal_init_path() { function drupal_lookup_path($action, $path = '', $path_language = '') { global $language; // $map is an array with language keys, holding arrays of Drupal paths to alias relations - static $map = array(), $no_src = array(), $count; + static $map = array(), $no_src = array(), $enabled; $path_language = $path_language ? $path_language : $language->language; - // Use $count to avoid looking up paths in subsequent calls if there simply are no aliases - if (!isset($count)) { - $count = db_query('SELECT COUNT(pid) FROM {url_alias}')->fetchField(); + // Avoid looking up paths in subsequent calls if path.module is not enabled. + // We can not rely on module_exists because path is bootstrapped before + // modules are loaded. + if (!isset($enabled)) { + $enabled = variable_get('path_enabled', FALSE); } if ($action == 'wipe') { @@ -60,7 +62,7 @@ function drupal_lookup_path($action, $pa $no_src = array(); $count = NULL; } - elseif ($count > 0 && $path != '') { + elseif ($enabled && $path != '') { if ($action == 'alias') { if (isset($map[$path_language][$path])) { return $map[$path_language][$path]; === modified file 'modules/path/path.info' --- modules/path/path.info 2008-10-11 02:32:32 +0000 +++ modules/path/path.info 2009-02-21 17:00:05 +0000 @@ -6,3 +6,4 @@ version = VERSION core = 7.x files[] = path.module files[] = path.admin.inc +files[] = path.install === added file 'modules/path/path.install' --- modules/path/path.install 1970-01-01 00:00:00 +0000 +++ modules/path/path.install 2009-02-21 17:03:47 +0000 @@ -0,0 +1,17 @@ +