Skip to main content
Tweeted twitter.com/#!/StackDrupal/status/171924370053267457
added 36 characters in body
Source Link

This is my hook_menu:

$items['events/%event'] = array(
  'title' => 'Event',
  'title callback' => 'entity_label',
  'title arguments' => array('event', 1),
  'page callback' => 'events_view',
  'page arguments' => array(1),
  'access callback' => 'entity_access',
  'access arguments' => array('view', 'event', 1),
  'file' => 'events.pages.inc',
);

return $items;

But when I navigate to events/2 there's a 404 error waiting! Here's the page:

Page not found!

As you can see, my Event has been successfully created (it exists in database and its id is definitely 2) but the requested page could not be found and Shortcuts menu and Navigation block has disappeared.
What possibly could I mistaken?
Feel free to ask for more information.
Thanks.

EDIT:
I'm using Drupal 7.12

This is my hook_menu:

$items['events/%event'] = array(
  'title' => 'Event',
  'title callback' => 'entity_label',
  'title arguments' => array('event', 1),
  'page callback' => 'events_view',
  'page arguments' => array(1),
  'access callback' => 'entity_access',
  'access arguments' => array('view', 'event', 1),
  'file' => 'events.pages.inc',
);

return $items;

But when I navigate to events/2 there's a 404 error waiting! Here's the page:

Page not found!

As you can see, my Event has been successfully created (it exists in database and its id is definitely 2) but the requested page could not be found and Shortcuts menu and Navigation block has disappeared.
What possibly could I mistaken?
Feel free to ask for more information.
Thanks.

This is my hook_menu:

$items['events/%event'] = array(
  'title' => 'Event',
  'title callback' => 'entity_label',
  'title arguments' => array('event', 1),
  'page callback' => 'events_view',
  'page arguments' => array(1),
  'access callback' => 'entity_access',
  'access arguments' => array('view', 'event', 1),
  'file' => 'events.pages.inc',
);

return $items;

But when I navigate to events/2 there's a 404 error waiting! Here's the page:

Page not found!

As you can see, my Event has been successfully created (it exists in database and its id is definitely 2) but the requested page could not be found and Shortcuts menu and Navigation block has disappeared.
What possibly could I mistaken?
Feel free to ask for more information.
Thanks.

EDIT:
I'm using Drupal 7.12

Source Link

'Page not found' but hook_menu() is correct!

This is my hook_menu:

$items['events/%event'] = array(
  'title' => 'Event',
  'title callback' => 'entity_label',
  'title arguments' => array('event', 1),
  'page callback' => 'events_view',
  'page arguments' => array(1),
  'access callback' => 'entity_access',
  'access arguments' => array('view', 'event', 1),
  'file' => 'events.pages.inc',
);

return $items;

But when I navigate to events/2 there's a 404 error waiting! Here's the page:

Page not found!

As you can see, my Event has been successfully created (it exists in database and its id is definitely 2) but the requested page could not be found and Shortcuts menu and Navigation block has disappeared.
What possibly could I mistaken?
Feel free to ask for more information.
Thanks.