0

I am seeing this error in my logs:

Theme hook MENU_CALLBACK not found

What are the causes? I cannot find this exact phrase in google or d.o. This is an example menu item:

$items['user/%user/integration/%integration'] = array(
    'title' => 'View An Integration',
    'page callback' => 'integration_view_page',
    'page arguments' => array(3),
    'access callback' => 'is_owner',
    'access arguments' => array(1, 3),
    'type' => MENU_CALLBACK,
);

Yes, cleared caches, including menu cache. The actual page appears to load ok.

1
  • You should get a stack trace. Maybe the logs already provide that? If you look into the actual apache error.log file.
    – donquixote
    Commented Jun 30, 2015 at 13:47

1 Answer 1

0

In my case, this was a mistake on my part. I recently performed a find and replace on my codebase to change all my menu hooks from MENU_LOCAL_TASKS to MENU_CALLBACK.

I clearly did this ignoring case, and also did not check properly as in my template.php, I now had...

$vars['secondary_local_tasks'] = array(
    '#theme' => 'MENU_CALLBACK',
    '#secondary' => $vars['tabs']['#secondary'],
);

instead of...

$vars['secondary_local_tasks'] = array(
    '#theme' => 'menu_local_tasks',
    '#secondary' => $vars['tabs']['#secondary'],
);

Because it was now called MENU_CALLBACK in caps, it confused me and I was looking in the wrong place. It is only when I went back and diff'd my entire backed up codebase did I notice it.

Lesson Learned: Find & Replace is not always a good idea :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.