Funky menu issue on Term page

Events happening in the community are now at Drupal community events on www.drupal.org.
tom.camp's picture

I am having an issue with the taxonomy/term/* pages and my menu and I figured that I would post here to see if anyone has any thoughts.

Here is what is going on; I am using the Primary Links and have a few items in the menu. When I go to a taxonomy/term page, certain items in the menu disappear. This only happens on the taxonomy/term/... pages. The pages that disappears are of the default content type Page and any content type Page that I add and a CCK content type and any of that type.

I have gone through the menu.inc and taxonomy.module and taxonomy.pages.inc, but I cannot see anything that would be causing this to happen.

I am using Drupal 6.22 and do not have any node access or taxonomy access modules installed.

I have been pounding my head against this for a couple of days and would love it if someone could throw me a bone.

Thanks,
Tom

Comments

Ok, I have found the culprit,

tom.camp's picture

Ok, I have found the culprit, but I am still not sure why this would be different on the taxonomy/term/* page.

On line 1008 of the menu.inc (Drupal 6.22) there is a db_rewrite_sql function that blocks access to the menu items.

function menu_tree_check_access(&$tree, $node_links = array()) {

  if ($node_links) {
    // Use db_rewrite_sql to evaluate view access without loading each full node.

    // THE NIDS ARRAY IS IDENTICAL TO OTHER PAGES WHERE THE MENU ITEMS SHOW AS EXPECTED
    $nids = array_keys($node_links);
    $placeholders = '%d'. str_repeat(', %d', count($nids) - 1);

    // IF I REMOVE THE db_rewrite_sql THE RESULTS ARE AS EXPECTED
    $result = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.status = 1 AND n.nid IN (". $placeholders .")"), $nids);
    while ($node = db_fetch_array($result)) {
      $nid = $node['nid'];
      foreach ($node_links[$nid] as $mlid => $link) {
        $node_links[$nid][$mlid]['access'] = TRUE;
      }
    }
  }
  _menu_tree_check_access($tree);
  return;
}

My understanding is that the db_rewrite_query adds a layer of access control to the query and only returns results that the user is allowed to see, but WHY, OH, WHY does it only block access on the taxonomy pages?!@

When in doubt, go downhill.

Umm... never mind ***

tom.camp's picture

Umm... never mind *** blushing *** One of my coworkers had added a hook_db_rewrite_sql and was filtering out taxonomy content for some reason that he can no longer recall. Oh, well. That is 3 days of work that I will never get back.

When in doubt, go downhill.

Umm... never mind ***

tom.camp's picture

Umm... never mind *** blushing *** One of my coworkers had added a hook_db_rewrite_sql and was filtering out taxonomy content for some reason that he can no longer recall. Oh, well. That is 3 days of work that I will never get back.

When in doubt, go downhill.

Menu

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week