When the TACL module is enabled, and I set it to allow "View" access for three out of four of our Taxonomy terms, I get duplicates in views based on that taxonomy vocabulary. In other words, if an item is tagged with two of the four Taxonomy terms, and anonymous users are allowed to access content tagged with those two terms, then the item will show up twice in views. Likewise, if it is tagged with three terms that anonymous users are able to access, it will show up three times.
This happens even when "Distinct" is set to "Yes" in the views. Disabling the TACL seems to fix the issue.
Comments
Comment #1
guypaddock commentedI forgot to mention that I'm using Views 6.x-2.7. In Views 6.x-3.0-alpha1, they fixed "distinct", so it will work to fix this issue, but it comes with a performance penalty. I don't have to use distinct when I'm not using TACL, so it looks like a TACL issue...
Please fix this, if possible. If you need any additional details, please let me know.
Comment #2
Dave Cohen commentedCan you paste here the two queries views generates? One without tac_lite enabled and another with it enabled.
Thanks.
Comment #3
hedac commentedI'm having the same issue having duplicates only for anonymous users in nodes that have multiple terms.
this is with TACL enabled creating duplicates for nodes that have multiple terms in a vocabulary:
and this is without TACL and it is working fine then:
Comment #4
Dave Cohen commentedIs enabling tac_lite really the only difference between those 2 queries?
The queries are different, but not in any way that tac_lite should be responsible for.
Please enable tac_lite, reproduce the problem. Then edit tac_lite.module... change the name of tac_lite_db_rewrite_sql() to be tac_lite_db_rewrite_sql_XXX(), or comment out the whole function. (Either way will prevent drupal from calling it) Then without that hook defined, see if the problem still occurs.
Based on the queries you've pasted, I don't think tac_lite is responsible. But who knows?
Comment #5
hedac commentedsorry finally I had time to try it
here is the sequence of things.. I have TACL disabled now and it is working fine
without TACL:
then I enable TACL module:
I see "The content access permissions need to be rebuilt. Please visit this page."
now I rebuild permissions:
"The content access permissions have been rebuilt."
go to views again and hit preview and tue query has changed
edited and commented out tac_lite_db_rewrite_sql()
flushed all caches
go and preview again the query:
so... we still don't know where is the problem
Comment #6
hedac commentedalso mention that now if I disable the TACL module...
I can see the DISTINCT in the query again fine. without having to rebuild permissions... I guess it is because there are no permissions module active now, but I still see the rebuild permissions button in the post settings... I don't know why....
Comment #7
Francesco Sottile commentedI got the same problem without using the TACL module ..
i guess it's a bug on the view module 6.x-2.7
Comment #8
glennw_d commentedI am also seeing the problem. It is clearly and interaction problem between views and tac-lite. I also see no "DISTINCT" when I choose it in the view.
I have not gone as far as hedac and changed the procedure name.
My situation is very similar but it is not only with anonymous users. I have an "Exposure" taxonomy vocabulary with 4 possible values. When the VIEW scheme has 2 Exposure selections for the role and the content has the same 2 selections, the view shows the content twice for that role.
When I change either the content or the VIEW scheme to have a single selection the content is only shown once.
Interestingly the super-user role has all 4 possible values in the scheme for the role but only shows the content once, even though DISTINCT is not part of the query.
Glenn
Comment #9
Dave Cohen commentedI understand this to be not a problem in tac_lite, but Drupal 6.14 core. Try the latest patch in this monster thread #284392: db_rewrite_sql causing issues with DISTINCT.