--- votingapi.module 2007-03-19 03:37:09.000000000 -0700 +++ votingapi.module 2008-04-22 21:38:05.000000000 -0700 @@ -8,6 +8,15 @@ define('VOTINGAPI_VALUE_DEFAULT_TAG', 'vote'); define('VOTINGAPI_VALUE_DEFAULT_TYPE', 'percent'); +function votinapi_init() { + // only bother when we are not serving a cached page. check for which function that only exists afterwards + if (function_exists('drupal_set_content')) { + if (module_exists('views')) { + include_once(drupal_get_path('module', 'votingapi') .'/votingapi_views.inc'); + } + } +} + function votingapi_menu($may_cache) { $items = array(); if ($may_cache) { @@ -20,9 +29,6 @@ 'type' => MENU_NORMAL_ITEM ); } - if (module_exists('views')) { - require_once(drupal_get_path('module', 'votingapi') .'/votingapi_views.inc'); - } return $items; } @@ -603,4 +609,4 @@ } return $cached[$table][$field]; -} \ No newline at end of file +}