When a node is not assigned any term (for example, a blog entry), it fails to show up for any users.

It turned out that the DB retrieval method (mysql) was not correct in taxonomy_access.module: on line , I changed "db_fetch_array" to "db_fetch_object" (just as is done for the "node assigned to a category" just below, which does work). The node_access table is now updated correctly.

I haven't tested the system extensively yet, so please report any potential problems this change could raise (I am pretty confident however since the original code uses db_fetch_object successfully below, as noted above)

HTH
Bruno

Comments

Anonymous’s picture

Sorry -- that was line 267

pyromanfo’s picture

Are you seeing this in the latest CVS? I don't think this should be happening with the latest version.

Anonymous’s picture

It's me again (i'll register on drupal.org, that'll make things easier!)
I downloaded the taxonomy_access module from here on March 29th, so I guess this is a fairly recent version.
As for my Drupal installation, I am using the Debian unstable package so this might not be bleeding edge, but i do not think his has any influence in this case?

Justin Freeman’s picture

I am experiencing this bug also. The only work-around I've found is to create a general "All" term and assign nodes to that term. Otherwise, nodes not assigned to any term will be denied access to anonymous users, regardless of the permission settings.

We are using Drupal 4.5. Would be good to get a fix to this problem soon.

Justin Freeman’s picture

Just noticed that if I go to the "category permissions" page and disable and then enable the anonymous user to view "uncategorized nodes" the permissions are set correctly and the page can be viewed.

So it appears to be something caused by the node be edited and submitted, the permissions for the node being calculated incorrectly somehow.

Justin Freeman’s picture

This change to the taxonomy_access.module seems to have fixed this problem. Changes start on line 265.

     // For nodes not assigned to a category
      if(!$tids || $tids==null) {
        $query = db_query('SELECT * FROM term_access where tid = 0');        
        while($result = db_fetch_object($query)) {
keve’s picture

This is weird, becuase acc. to php manual:
Considering If(!$tids)
the following values are considered FALSE:
the integer 0 (zero)
an array with zero elements
the special type NULL (including unset variables)

For me, (!$tids) and ($tids==null) seems to be the same. {Unlike ($tids===null)}

http://www.php.net/manual/en/language.types.boolean.php#language.types.b...

keve’s picture

Status: Active » Closed (fixed)

It is fixed with latest versions. (It was a problem in the hook_nodeapi)