I have created a module that implements hook_menu() using the following code:

function mypbm_menu() {
  $items['pbg'] = array(
    'title' => 'Theming example',
    'description' => 'Examples of implementing theme functions.',
    'page callback' => 'pbg',
    'access callback' => TRUE
  return $items;

function pbg($id) {
  $stringit = $id;

  return $stringit;

The module works the way it is supposed to work; when it is turned on, the Administration menu module disappears.

Does anyone know why?

  • 2
    Could be something else, maybe something in a theme function in your module? Also, are you clearing caches? If you look at your page's markup (HTML), do you still see the admin menu links added somewhere? It doesn't seem your hook_menu should interfere with admin_menu... Commented Jun 3, 2011 at 15:15
  • I had a similar issue, even filed a support request drupal.org/node/1553208. Although later on I found out a new config setting for admin_menu that caches the menu locally. I'm observing it now. unchecking it seems to have helped. Commented Apr 30, 2012 at 22:30
  • On another note, even though you're the only one using your callback function, it's still good practice to namespace everything.
    – Chapabu
    Commented May 1, 2012 at 9:56

1 Answer 1


The reason in my case was the character encoding of the "mymodule.module" file. Changing it back from "UTF-8" to "ANSI" solved the problem.

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.