In my setup, a user can own more entities of a specific content type but the ownership is stored in the entity. The user entity does not 'know' anything about this. I know without context it seems weird but in my case, it made more sense like this instead of having an entity reference field on the user.
Now I'm trying to build an Entity Reference Display for a view so that for certain autocomplete fields I can search for users by either their name or the title of the entities they own. I created a view before that showed all the users and all of their entities so I was hoping I can reuse that field here but it seems like if I set the entity reference field to search by this field as well it just adds this view field's id to the query as if it was a user's field and it gives (of course) column not found SQL exception.
I've also tried to add a join with a view query alter hook but I could not figure out how to get the text entered by the user as that seems to be neither in exposed_raw nor in args.
Here is how my relationship is set up:
Entity -> Field referencing a paragraph that describes the ownership -> field referencing a user
And here is what I tried based on @stevekeiretsu's comment:
- I set up a relation to paragraphs that have that field referencing a user
- Then I added another relation to content that has that field referencing this paragraph.
- Then I added the Title field of content to the view
The problem is that it still does not show anything. If I set the relations to required I have no results.