Compare these two webpages:

http://opl.cias.rit.edu/node/53
-Does not use Node Type Filter to filter content

http://opl.cias.rit.edu/taxonomy/term/27?type=biography
-Does use Node Type Filter to filter content

Notice that the second webpage, the webpage that does use Node Type Filter, does not display the "Projects" link in the Primary Links menu.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NancyDru’s picture

Assigned: Unassigned » NancyDru
Status: Active » Postponed (maintainer needs more info)

Interesting problem. How is the "Projects" link being built? I'm assuming you have some contributed module doing it. I also assume that node/53 is not of the "biography" type.

This module intercepts all db_rewrite_sql calls and applies the node filtering to them. I'm not sure that there is any easy way to prevent the module that is building the "Project" menu item from being affected by the filtering.

john.karahalis’s picture

The "Projects" menu item was created by hand in admin/build/menu. The Project page itself is created by Views, but I don't think that should have an effect on the menu item.

And yes, you are correct that node/53 is not of type "biography". It is of type "page".

NancyDru’s picture

Ahh, and Views will do a db_rewrite_sql, so it too is being subjected to the node_type_filter.

NancyDru’s picture

Is this still occurring with the -dev version?

jordiestrada’s picture

When I enable this module, I lost node reference of my content type.

NancyDru’s picture

Since I cannot reproduce this, I need you to test this. Please try the entire function with this:

function node_type_filter_db_rewrite_sql($query, $primary_table, $primary_field, $args) {
  if ($primary_field == 'nid' && $primary_table=='n') {
    if (isset($_GET['tfilt']) && $str_types = $_GET['tfilt']) {
      $types = explode(',', $str_types);
      foreach ($types as $type) {
        $ctypes[] = db_escape_string($type);
      }
      return array('where' => 'n.type IN (\''. implode("','", $ctypes) .'\')');
    }
  }  
} 

NOTE: this change the module from using "type" to "tfilt" so other modules that set this parameter (e.g. Taxonomy Browser) will not work with this change.

If this works, I will try to come up with a more generic way to fix this.

NancyDru’s picture

Status: Postponed (maintainer needs more info) » Needs review
milos1234’s picture

subscribe

milos1234’s picture

i have the same problems, almost all of my menu items are disappearing when using this module. the new function doesnt seem to fix it.
thanks!

nrackleff’s picture

I am having the same problem where 2 of 4 primary menu links disappear when I filter a page view by node type. I am attaching two screen shots. The Not_filtered screen has 4 nav items and then once I filter it, you can see that there are only two.

greekman’s picture

The same problem here,
it makes disappear some menus

mitnickhun’s picture

this fix doesnt work at me:\