Closed (fixed)
Project:
Forum Access
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2012 at 04:52 UTC
Updated:
25 Sep 2012 at 06:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
karingI'll try and reproduce this. Please tell me exactly which versions you're using of the modules involved.
Comment #2
polluxmr2 commentedForum Access 6.x-1.8
Core 6.26
Advanced Forum 6.x-2.0-beta1
and also Taxonomy Access Control 6.x-1.3 that might be getting in the mix but i can't say for certain.
edit: and ACL 6.x-1.4
edit #2: the perm 'administer nodes' gets the dropdowns in the view to populate as one would expect but for obvious reason i don't want to grant that to every user.
Comment #3
sadashiv commentedI was facing the same problem and i have following modules installed
Forum access 6.x-1.8
Core 6.22
Advanced Forum 6.x-2.0-beta1
ACL 6.x-1.4
I debugged the forum_access_db_rewrite_sql hook for finding the reason and found that when we expose taxonomy terms in views this hook gets called for building the query and as authenticated or anonymous users don't have the above(administer nodes or administer forum) permissions and he is not on forum create page so the else part gets executed i.e.
else {
$required_access = 'view';
}
and
$sql['join'] = "LEFT JOIN {forum_access} fa ON $primary_table.tid = fa.tid
LEFT JOIN {acl} acl_fa ON acl_fa.number = $primary_table.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 = $user->uid";
$sql['where'] = "(fa.grant_$required_access >= 1 AND fa.rid IN ($roles)) OR fa.tid IS NULL OR aclu_fa.uid = $user->uid";
$sql['distinct'] = 1;
Here the sql query is joined with forum_access table which fails the condition and returns no results may be hence we get a exposed taxonomy with only "Any" as option.
I added the above code i.e. || empty(args).
When this hook is invoked from views module we get args as empty.
Comment #4
edsel commentedSorry that did not work for me...:(
Edit: Working now, error was due to something else :)
Comment #5
karingWould you please confirm the following steps should reproduce what you're observing:
1. views/edit/advanced_forum_topic_list
Filters + Taxonomy: Vocabulary exposed
Create Page display
2. on that Page - masquerading as a user (with role that has NO administer nodes permissions) - the issue is that I would not be able to select any of the Taxonomy: Vocabulary options when I click on the select box (current value = Forums).
As in (screenshot):

Can't reproduce this as of yet - things are working fine when masquerading as such a user - but I have some small version diff-s for the modules at play here. Will systematically update them to figure out if/when things break. But let me know if these steps should reproduce what you're observing. We need a specific test scenario for this.
-- KarinG
Comment #6
polluxmr2 commentedI did as sadashiv suggested. However, before i did it i captured the default behavior in screenshots.
KarinG, here are some screenshots before i made any changes. bad1 is a list of terms and bad2 is the list of vocabularies.
good1 is a list of terms after i applied the changes that sadashiv suggested. My only concern is that i see some terms in there that should be locked down by FA but i will double check my setups because there are 15 potential terms/forums locked down by FA but i only see 3 in the list that shouldn't be there so chances are i missed something and its not something else.
thanks everyone for the help!
Comment #7
karingThanks for the screen shots - I've been able to reproduce the issue with the latest -dev: 6.x-1.8+1-dev
3. Added a second Filter: + Taxonomy Term ID (with depth).
4. Masquerading as user w/ role that has Forum Access permissions: the user can select (and Apply) terms from the Taxonomy Vocabulary - but can NOT select from the Taxonomy Term ID (with depth). shows but select terms underneath that are 'blank'.
5. Adding 'administer nodes' permission to the role that the user belongs to does allow the user to select terms from the Taxonomy Term ID (with depth).
I'll have a detailed look at the code tomorrow.
Comment #8
karingSorry - ran out of time to look at this today - have slotted it in for tomorrow.
Comment #9
RedRat commentedI have absolutely the same problem: when I turn on Forum Access, all my users can't use taxonomy in exposed filters. I have installed a testing site with Drupal 6.26, ACL 6.x-1.4, Forum Access 6.x-1.8 and Views 6.x-2.16, so I can test any patches to solve this nasty bug.
Comment #10
karingI've also confirmed that #3 does solve the problem - but I'm wondering if there may be better ways to go about this. salvis is on a (well deserved) vacation. I'm sure he'll have a peak at this shortly after he returns. Thanks everyone for helping to detail this.
Comment #11
sadashiv commentedI agree with you. Need to debug more and find a more precise way to fix this problem. The change suggested by me is just a workaround which i came up with and i have not explored all options available.
Comment #12
salvis(commenting from Madagascar without any code insight)
We probably need to limit the filtering to tids that belong to the forum vocabulary.I think there's even a separate issue requesting that, but it wasn't convincing enough.
Comment #13
batdesign commentedI had similar issues with exposed Views taxonomy filter dropdowns having no options for anonymous users.
Adding to the .module file with the code in #3 fixed (after a cache flush).
Comment #14
salvisThis is a Views bug. The fix for it was committed on 2011-11-17 as a result of #1040744-8: Only one term available in exposed "Taxonomy: Term ID" filter widget..
As dawehner wrote in #14:
Unfortunately, 6.x-2.17 has never seen the light of day, and the -dev version has been hidden.
BTW, I had found this before in #1041168-6: exposed filter not populated with taxonomy, not using forum vocabulary, but I had forgotten about it — I've put it on the front page now.
P.S. We've wasted a couple more hours of our lives on this. I wouldn't mind if everyone went over to the Views queue and complained...
Comment #15
batdesign commentedReopened #1040744-8: Only one term available in exposed "Taxonomy: Term ID" filter widget. in Views issue queue so hopefully the patch will get moved into a dev branch and a 2.17 will appear eventually.
Comment #16
salvis