Avatar of drupal_100
drupal_100Flag for United States of America

asked on 

drupal hook_menu incorrect affect menu_rebuild - where see the log

When I try to create view, and also something else, the menu could not be rebuilt well, and can not access the view page... at all.
After long time effort, found out that my module did not do well on hook_menu, and I fix it. All work well again. When creating view, create record in menu_router well...

So if something wrong in hook_menu, it will affect the menu_rebuild and make all menu_router related things not working. But there is no error log information about this.

If something incorrect in hook_menu, where could I get some information about it?

The following is correct hook_menu.
function test_menu() {
  $items['testpage'] = array(
    'page callback' => 'testpage',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
    );
  return $items;
}

function testpage() {
  return 'This is a test page';
}
DrupalPHP

Avatar of undefined
Last Comment
drupal_100
SOLUTION
Avatar of Randy Downs
Randy Downs
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Hagay Mandel
Hagay Mandel
Flag of Israel image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of drupal_100
drupal_100
Flag of United States of America image

ASKER

I will be very careful when working on hook_menu
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo