I've searched a lot the Views issue queue, searched for other modules, searched on stackexchange, but it seems that no one needs this functionality (or that there's another way to achieve it).
Use case: I have two content types: lecture and substitute teaching. A teacher uses the lecture content type when he has a normal lecture in a class where he has a chair. A teacher uses the substitute teaching when another teacher isn't at school (ill or in an excursion) and he has to replace the colleague.
In the lecture content type I have put an entity reference field named "chair", which filters the chairs so only the tearcher's ones are shown. For doing this I use the entity selection section of the field, and pass via token the teacher's uid to the view. But in the substitute teaching content type, I don't want to filter the chairs. Since a teacher could replace anyone, I need an unfiltered list of chairs.
Since the entity selection part of the field is applied everywhere this field is used, I had to create another entity reference field in the substitute teaching which references the chair content type, but without filtering. Having the same content type pointed, but using two different fields, is leading to maintenance nightmares (put both the content types and filter them based on chair field is nearly impossible), so I'm seeking for a different approach.
I think that a good one would be to pass to the view the uid and the content type. If the content type is "lecture", then apply filtering, otherwise don't. In this way I could use the same field in both the content types and everythig would work smothly. Well, it seems impossible to do such a simple thing.
The only solution that got me near the desired result was using conditional fields, but when filtering I got a bunch of empty option values where the view result was hidden, but it was selectable.
Any help or hint would be appreciated. Thanks!