Download & Extend

Node Type Filter seems to hide certain Primary Links

Project:Node Type Filter
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:NancyDru
Status:needs review

Issue Summary

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.

Comments

#1

Assigned to:Anonymous» 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.

#2

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".

#3

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

#4

Is this still occurring with the -dev version?

#5

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

#6

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.

#7

Status:postponed (maintainer needs more info)» needs review

#8

subscribe

#9

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!

#10

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.

AttachmentSize
not_filtered_by_node_type.png 20.42 KB
filtered_by_node_type.png 19.58 KB

#11

The same problem here,
it makes disappear some menus

#12

this fix doesnt work at me:\