Node Type Filter seems to hide certain Primary Links

Open Publishing... - April 20, 2008 - 05:29
Project:Node Type Filter
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:NancyDru
Status:needs review
Description

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.

#1

NancyDru - April 20, 2008 - 17:52
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

Open Publishing... - April 20, 2008 - 22:06

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

NancyDru - April 21, 2008 - 00:57

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

#4

NancyDru - September 16, 2008 - 16:13

Is this still occurring with the -dev version?

#5

jordiestrada - March 24, 2009 - 16:05

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

#6

NancyDru - March 25, 2009 - 13:41

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

NancyDru - March 25, 2009 - 13:42
Status:postponed (maintainer needs more info)» needs review

#8

milos1234 - April 22, 2009 - 17:38

subscribe

#9

milos1234 - April 22, 2009 - 17:44

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

nrackleff - June 26, 2009 - 17:00

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
 
 

Drupal is a registered trademark of Dries Buytaert.