Q:

Drupal 7 filter field current user

I've created a custom event content type in Drupal 7 with user fields of teacher and student. I would like to create a view in which the content is displayed only for the users who are either teachers or students in that content - a custom calendar.
So far, I've tried to create a filter on Content: Teacher (field_teacher), using user:uid and user. I know it's a syntax problem, but I need the value to be currentlyLoggedinUser

A:

It was actually a pretty simple solution - I created contextual filters on the two entity references (student and teacher), then in the section "If no default provided", I added "use currently logged in user".
I then had to write a custom module with a hook_query_alter to change the contextual filter's AND to an OR

