menu callback 'node/$arg/reviews' collide with view

yhager - December 14, 2007 - 08:42
Project:NodeReview
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

The menu callback for 'node//reviews' is defined like this:

        $items[] = array(
          'path' => 'node/' . arg(1) . '/reviews',
          'callback' => 'views_page',
          'callback arguments' => array('review list', arg(1)),
          'type' => MENU_LOCAL_TASK,
          'title' => t('Reviews'),
          'weight' => 2,
          'access' => user_access('read reviews'),
        );

This code obviously doesn't work ('views_page() does not exist, 'callback arguments' are also wrong). However, the URL 'node//reviews' does work.. This happens since the default view 'review_list' is defined like this:
  $view->url = 'node/$arg/reviews';

So the 'views_menu' hook actually fixes the wrong information from nodereview_menu, but leaving some of the info intact..
In short - this is a mess, that should be resolved, although it looks like working, it took me a while to find out what is going on here..

 
 

Drupal is a registered trademark of Dries Buytaert.