It would be ridiculously useful for the Views bulk select field provided by Entity Browser to support Views relationships. By doing that, you could have a view that displays entities of one type, but actually selects related entities. This would be hugely useful in Lightning's case (where you need to be able to select file entities from a library of media entities), and I imagine in many other cases as well. And it's a simple change!

First pass at a patch attached.

Comments

phenaproxima created an issue. See original summary.

samuel.mortenson’s picture

StatusFileSize
new516 bytes

Replicated the problem, and confirmed the patch fixes it. However, if a View doesn't use a relationship, this doesn't work because the logic checks if $this->options['relationship'] evaluates to TRUE, which it always will since if you don't use relationships $this->options['relationship'] equals "none". This patch calls the getEntity() method instead, which should handle the relationship logic for us.

phenaproxima’s picture

OK, I am absolutely in love with @samuel.mortenson's patch in #2. I didn't even know there was a getEntity() method. I wish I could RTBC that patch. In fact, I want to marry it.

Whole-hearted +1 from me.

slashrsm’s picture

Status: Needs review » Fixed
Issue tags: +D8Media

This is great. Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.