1

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... – geerlingguy Jun 3 '11 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. – Artur Apr 30 '12 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 May 1 '12 at 9:56
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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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