I'm feel like I'm losing my mind here. I have written a custom module and implemented hook_menu
to add custom admin pages. Last week this worked perfectly - this week they stopped working then vanished altogether. I can't understand what the problem is and I can't even get simple pages to work now.
This is the code I am using.
nhs_session_judge.module
/**
* Implements hook_menu().
*/
function nhs_session_judge_menu() {
$items['admin/session-judging'] = array(
'title' => 'Your judging',
'page callback' => 'your_judging_page',
'access arguments' => array('access administration pages'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
/**
* Custom page callback
*/
function your_judging_page() {
$content['raw_markup'] = array(
'#type' => 'markup',
'#markup' => '<p>This table shows at-a-glance the session bids you have already scored and those yet to be judged.</p>',
);
// â¦
return $content;
}
If I use a backup of the database and visit the page, it works.
If I make a change, I get this error.
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'your_judging_page' not found or invalid function name in menu_execute_active_handler()
If I clear the cache, the menu item disappears. Visiting the page by entering the URL directly in the browser address bar just redirects to /admin.
Does anyone know what's going on here? I can't make any changes/fixes to this because as soon as I do it breaks.