diff -Naur old/taxonomy_delegate/taxonomy_delegate.module new/taxonomy_delegate/taxonomy_delegate.module --- taxonomy_delegate/taxonomy_delegate.module 2010-04-14 14:17:09.816568538 +1000 +++ taxonomy_delegate/taxonomy_delegate.module 2010-04-14 14:24:45.192557426 +1000 @@ -26,6 +26,20 @@ } /** + * Function called to determine whether the category_admin should be display.or not. + * It's said to be "ugly" to check this in the 'access callback', but the nice solution + * do not work at all (taxonomy_delegate_load function is never called). + * For more information, see: http://drupal.org/node/291665 + */ +function check_count() { + $any = count(_taxonomy_delegate_my_vocabularies()); + if ($any) { + return TRUE; + } + return FALSE; +} + +/** * Implementation of hook_menu(). */ function taxonomy_delegate_menu() { @@ -41,16 +55,14 @@ 'type' => MENU_LOCAL_TASK, ); - // User admin callback. - $any = count(_taxonomy_delegate_my_vocabularies()); - if ($any) { - $items['category_admin'] = array( - 'title' => '@name', - 'title arguments' => array('@name' => variable_get('taxonomy_delegate_menu', t('Administer My Categories'))), - 'page callback' => 'taxonomy_delegate_mycategories', - 'access arguments' => array('access content'), - ); - } + // User admin callback. + $items['category_admin'] = array( + 'title' => '@name', + 'title arguments' => array('@name' => variable_get('taxonomy_delegate_menu', t('Administer My Categories'))), + 'page callback' => 'taxonomy_delegate_mycategories', + 'access callback' => 'check_count', + 'access arguments' => array('access content'), + ); // Admin settings. $items['admin/settings/taxonomy_delegate'] = array(