diff -urp --strip-trailing-cr ../category/category.module ./category.module --- ../category/category.module 2009-08-05 06:52:53.000000000 +0200 +++ ./category.module 2009-09-20 00:40:47.000000000 +0200 @@ -317,7 +317,7 @@ function category_menu() { */ function category_init() { drupal_add_css(drupal_get_path('module', 'category') .'/category.css'); - require_once dirname(drupal_get_filename('module', 'category')) .'/category.inc'; + module_load_include('inc', 'category'); } /** @@ -866,6 +866,10 @@ function category_node_type($op, $info) * Handles category loading, inserting and updating. */ function category_nodeapi(&$node, $op, $teaser, $page) { + // Ensure that category.inc is loaded. We generally do that in hook_init(), + // but some faulty modules might call a node_load() even before that runs. + module_load_include('inc', 'category'); + switch ($op) { case 'load': $output = array();