Hello

drupal is not registering the menu path

here is my code

//****************Menu Hook********************

function customsearch_menu($may_cache) {

$items = array(); // This menu is working//

if ($may_cache) {

$items[] = array(

'path' => 'customsearch/form',

'title' => t('Search'),

'description' => t('Enable custom search.'),
'callback' => 'customsearch_formRender',

'access' => true
);

$items[] =array(
'path' =>'customsearch/member', //this menu is working//
'title' =>'searchresult',
'callback'=>'customsearch_member',
'type' =>MENU_CALLBACK,
'access' =>true,
);
//ajax menu call back
$items[] =array(
'path' =>'customsearch/caste', // THIS IS NOT WORKING//
'callback'=>'customsearch_caste_dropdwn',
'type' =>MENU_CALLBACK,
'access' =>true,
);
$items[] =array(
'path' =>'customsearch/result', // this is also working//
'title' =>'searchresults',
'callback'=>'customsearch_result',
'access' =>true,
'type' =>MENU_CALLBACK,
);

}

return $items;

}

i am getting 404 error when aceesing the path 'customsearch/caste',

Comments

jaypan’s picture

Is this:

'callback'=>'customsearch_caste_dropdwn',

maybe supposed to be this:

'callback'=>'customsearch_caste_dropdown',

(you are missing an 'o' in 'drowdown')

Contact me to contract me for D7 -> D10/11 migrations.

sujith7c’s picture

No that is name of the function

jaypan’s picture

Let's see your code (the callback function)

Contact me to contract me for D7 -> D10/11 migrations.

rolf van de krol’s picture

Did you empty the cache?

ikeigenwijs’s picture

    $items = array();
//this one works
    $items['revaki_planning/instructies'] = array(
            'title' => t('Instructie voor het hele maak planning proces'),
            //'page callback' => 'revaki_make_page', // Roept pagina planning_page op.
            'page callback' => 'revaki_planning_instructions_page',
            'access arguments' => array('access content'),
            'type' => MENU_CALLBACK, //'type' => MENU_CALLBACK, voor de pagina beschikbaar te maken, maar niet zichtbaar in menu systeem
            'weight' => 1,
    );
//this one will not work, i can go to the adress, but than page not found
        //Resultaat van de maak planning
    $items['revaki_planning/result/%'] = array(      
            'title' => t('Resultaat van de gemaakte planning'),
            'page callback' => 'revaki_planning_result_page',
            'page arguments' => array(2),//org2
            'access arguments' => array('access content'),
            'type' => MENU_CALLBACK,
//            'weight' => 10,
    );   

//callback to
function revaki_planning_result_page($planoplossing_nid=NULL){
    
    $content='';
   
    if ($planoplossing_nid!=NULL){ //result of 1 maak planing
        //views_embed_view($name, $display_id = 'default') 
       $view_arg = array($planoplossing_nid);
       $content = views_embed_view('bekijk_specifieke_opl', 'default',$view_arg);                
    }
    else{   //overview all solutions with filter
        $content = views_embed_view('alle_plan_oplossingen', 'default');
        
    } 

    return $content;
    
}

jaypan’s picture

Can you please show your actual hook_menu() function, instead of the mashup you've put there?

Contact me to contract me for D7 -> D10/11 migrations.