I've tried both recommended releases, and both dev releases. error is the same.

I have 2 pages created with Views (6.x-3.x-dev) module, drupal 6.20, that use exposed taxonomy filters.

On both pages they are not displayed to anonymous and authenticated users. (when viewing node with user 1, exposed taxonomy filter displays records)
Both views don't use Forum vocabulary. each views uses different vocabulary and there are less then 10 terms in each vocab.

If Forum access module is disabled, the exposed filter is populated with taxonomy records for authenticated/anonymous users.
both views have no access restrictions, that's why I created the issue on Forum access issue list.

sorry if I'm missing something, please direct me to the right topic if this already has been answered. (I did search the issues for problem that would involve exposed taxonomy filters).
If I can help myself showing you some devel info, please direct me to a link to get more info.

I don't have installed any other access module, at least, I think so. :D
Thank you!

CommentFileSizeAuthor
views-examp.png17.01 KBjanis_lv
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

janis_lv’s picture

in picture "tips" and "prioritate" are taxonomy filters.

salvis’s picture

This will be difficult. I've never encountered that problem and can't think of why it could happen.

My first idea is to install Devel module and enable its query logger. Find the queries that are different for user 1 and user 2. Try to identify those that are used for populating the term lists. Use a tool like phpMyAdmin to run them against your database and verify what they return.

janis_lv’s picture

thank you for the reply, I'll try that and report back.

edit:

before I did devel part, I created another role, enabling few permissions to see, if I can identify the culprit, as user1 did see the taxonomy populated.

If for the the test role "node modules" - administer nodes permission is granted then the view was populated with taxonomy.

Then I copied the queries from devel to two different files, run a diff on them. except for the minor ms numbers and so on, I found only 3 differing entries.

queries from view with "administer nodes" permission:

  1. 0.071 value_form SELECT * FROM term_data t WHERE t.vid = 4 ORDER BY t.weight, t.name
  2. 0.431 db_query_range SELECT DISTINCT node.title AS node_title, node.nid AS nid, node.created AS node_created FROM node node WHERE (node.type in ('video')) AND (node.status = 1) ORDER BY node_created DESC LIMIT 0, 1
  3. 0.071 menu_tree_check_access SELECT DISTINCT n.nid FROM node n WHERE n.status = 1 AND n.nid IN (4801, 6155)

and queries from the view when "administer nodes" permission is not granted:

  1. 0.951value_form SELECT DISTINCT * FROM term_data t LEFT JOIN forum_access fa ON t.tid = fa.tid LEFT JOIN acl acl_fa ON acl_fa.name = t.tid AND acl_fa.module = 'forum_access' LEFT JOIN acl_user aclu_fa ON aclu_fa.acl_id = acl_fa.acl_id AND aclu_fa.uid = 1668 WHERE ((fa.grant_view >= 1 AND fa.rid IN (2, 10)) OR fa.tid IS NULL OR aclu_fa.uid = 1668) AND ( t.vid = 4 )ORDER BY t.weight, t.name
  2. 0.074acl_node_grants SELECT acl_id FROM acl_user WHERE uid = 1668
  3. 0.154acl_node_grants SELECT acl_id FROM acl_user WHERE uid = 1668
  4. 15.171db_query_range SELECT DISTINCT node.title AS node_title, node.nid AS nid, node.created AS node_created FROM node node INNER JOIN node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'forum_access') OR (na.gid = 10 AND na.realm = 'forum_access'))) AND ( (node.type in ('video')) AND (node.status = 1) )ORDER BY node_created DESC LIMIT 0, 1
  5. 0.094acl_node_grants SELECT acl_id FROM acl_user WHERE uid = 1668
  6. 0.451menu_tree_check_access SELECT DISTINCT n.nid FROM node n INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'forum_access') OR (na.gid = 10 AND na.realm = 'forum_access'))) AND ( n.status = 1 AND n.nid IN (4801, 6155))

1st query generates the entries for the missing taxonomy filter, 11 rows.
end with the administer node permission it returns output like:

| tid | vid | name | description | weight |
| 55 | 4 | css | | 0 |

1st query without the permission generates something like this:

| tid | vid | name | description | weight | tid | rid | grant_view | grant_update | grant_delete | grant_create | priority | acl_id | module | name | number | acl_id | uid |
| 55 | 4 | css | | 0 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL |

salvis’s picture

You're getting the same rows, only with additional columns?

What happens if you replace the "*" with "t.*"? I wonder where that query comes from. Is it constructed by Views?

I suspect that the tid value which is NULL overwrites the tid value which is 55.

janis_lv’s picture

Yes, I get the same rows with additional columns.

If * replaced with t.* then both queries output the same. no additional columns.

| tid | vid | name | description | weight |
| 55 | 4 | css | | 0 |

Yes, the query comes from Views, exposed filter using taxonomy in a Page created by Views.
thank you for your help so far !

salvis’s picture

Project: Forum Access » Views (for Drupal 7)
Version: 6.x-1.x-dev » 6.x-3.x-dev

This needs to be fixed in Views.

This issue is likely to show up with other taxonomy access modules, too, e.g. tac_lite.

dawehner’s picture

I'm pretty sure there is a patch already in the issue queue.


          $result = db_query(db_rewrite_sql("SELECT * FROM {term_data} t WHERE t.vid = %d ORDER BY t.weight, t.name", 't', 'tid'), $vocabulary->vid);
        }
        else {
          $result = db_query(db_rewrite_sql("SELECT td.* FROM {term_data} td INNER JOIN {vocabulary} v ON td.vid = v.vid ORDER BY v.weight, v.name, td.weight, td.name", 'td', 'tid'));
        }

This queries might have to be changed.

janis_lv’s picture

salvis, dereine, thank you for your help and info.

I'll browse trough the Views issue queue to find the patch.

edit: I'll try this patch, http://drupal.org/node/1040744

iamjon’s picture

Status: Active » Closed (duplicate)

Based on janis_lv's comment on #1040744: Only one term available in exposed "Taxonomy: Term ID" filter widget. marking this as a dupe and closing.