2
votes

I have a list of nodes. Under each node I have opened up commenting. Normal users can comment, special users can respond to the comments.

I want a normal user to see only their comments when viewing such a node AND the responses by the special roles.

I have been experimenting with views but using either a filter or contextual argument of current user:uid only shows the comments by the user, leaving out the responses by admin/editors, etc :(

Appreciate any pointers.

Thanks

1

1 Answers

0
votes

You need to user logic similar to comment_uid = current_uid OR comment_users_role = special_role.

The problem here is that it is hard to use OR logic with contextual filters. This post is discussing the topic and the chosen answers points to this page which has a patch that allows you to pass the value from the contextual filter to the "normal filter".

That is certainly one path to explore, another option would be to user hook_views_query_alter to manually change your query before it is executed. For an example of how to do that see this post.