I'm new to drupal so if this is spurious, please be nice:

In version 1.302.2.9 of the comment.module file, in the comment_menu hook/callback, for the statement starting at line 112 (containing 'path' => 'admin/comment/list/approval'), it looks like if caching is turned off ($may_cache is false), then the $access variable will be undefined.

Maybe this is intentional, but I thought I'd ask.

Here's the code snippet:

function comment_menu($may_cache) {
  $items = array();

  if ($may_cache) {
    $access = user_access('administer comments');
    $items[] = array('path' => 'admin/comment', 'title' => t('comments'),
      'callback' => 'comment_admin_overview', 'access' => $access);
    $items[] = array('path' => 'admin/comment/edit', 'title' => t('edit comment'),
      'callback' => 'comment_admin_edit', 'access' => $access, 'type' => MENU_CALLBACK);
    $items[] = array('path' => 'admin/comment/delete', 'title' => t('delete comment'),
      'callback' => 'comment_delete', 'access' => $access, 'type' => MENU_CALLBACK);

    // Tabs:
    $items[] = array('path' => 'admin/comment/list', 'title' => t('list'),
      'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
    $items[] = array('path' => 'admin/comment/configure', 'title' => t('configure'),
      'callback' => 'comment_configure', 'access' => $access, 'type' => MENU_LOCAL_TASK);
    if (module_exist('search')) {
      $items[] = array('path' => 'admin/comment/search', 'title' => t('search'),
        'callback' => 'comment_search', 'access' => $access, 'type' => MENU_LOCAL_TASK);
    }

    // Subtabs:
    $items[] = array('path' => 'admin/comment/list/new', 'title' => t('new comments'),
      'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
    $items[] = array('path' => 'admin/comment/list/approval', 'title' => t('approval queue'),
      'callback' => 'comment_admin_overview', 'access' => $access,
      'callback arguments' => 'approval',
      'type' => MENU_LOCAL_TASK);

Ben in DC
PublicMailbox at benslade dot.com
(append 030516 to the subj to bypass spam filters)
"It's the mark of an educated mind to be moved by statistics"
Oscar Wilde

Comments

morbus iff’s picture

Assigned: Unassigned » morbus iff

No longer applies in HEAD, and invalid in 4.5.2 -- the $access is within the $may_cache, and the reporter is probably getting confused over the if ($search) ending bracket.