Well it is not a bug but is kinds undeed source you have in the menu hook. The menu in drupal 6.* is caches and is rebuild only when you go to admin/build/modules or in the admin you select to rebuild menu with the devel module. All the rest cases the menu is cached and actually if you start fresh install of the module and then add some indexes then "search/main_index" and "search/main_index/%" paths will not be added to the menu before you rebuild it. All this source from the menu hook :

$res = db_query('SELECT iid, display_name, path FROM {sphinx_indexes} WHERE active = 1');
while ($indexes = db_fetch_object($res)) {
$items['search/'. $indexes->path] = array(
'title' => t('Search !index', array('!index' => $indexes->display_name)),
'description' => t('Search !index', array('!index' => $indexes->display_name)),
'page callback' => '_sphinx_search_page',
'page arguments' => array(1, ''),
'access callback' => user_access('use index '. $indexes->display_name .'('. $indexes->iid .')'),
'type' => ($indexes->path == variable_get('sphinx_default_index', '')) ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
);
$items['search/'. $indexes->path. '/%'] = array(
'title' => t('Search !index', array('!index' => $indexes->display_name)),
'description' => t('Search !index', array('!index' => $indexes->display_name)),
'page callback' => '_sphinx_search_page',
'page arguments' => array(1, 2),
'access callback' => user_access('use index '. $indexes->display_name .'('. $indexes->iid .')'),
'type' => ($indexes->path == variable_get('sphinx_default_index', '')) ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
);
}

is kinda unneded cause it will always call the _sphinx_search_page with the appropriate arguments.
Well that is just a suggestion for a cleaner code :)

Comments

johsw’s picture

Status: Active » Postponed

There is no official d6 release yet.

johsw’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Postponed » Active

I do it this way to make it possible to have per index permissions (that could be done with a custom access function), but it also allows a MENU_DEFAULT_LOCAL_TASK

Please send me a patch, if you've got a cleaner way to do it.

johsw’s picture

Status: Active » Postponed (maintainer needs more info)
nestor.mata’s picture

Status: Postponed (maintainer needs more info) » Fixed

This is fixed in version 6.x-1.2.
I still want to do it in a cleaner way, but for the moment, any modification on the indexes rebuilds the menu, which solves the problem.

~Nestor

nestor.mata’s picture

Status: Fixed » Closed (fixed)

Closing ticket