As requested in #1522532: Sorting issue with Field Collection in Views and #1809122: Support for generic entity? there is a need for more relationships as only for "node" and "comment".

The attached patch removes hook_votingapi_relationships() and adds a loop to register relationships for all entity types available in the system.

Thanks to Daniel Wehner for helping understanding Views a bit better!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dasRicardo’s picture

FileSize
1.94 KB

Here is the patch.

jay.lee.bio’s picture

Priority: Normal » Critical
Status: Needs review » Fixed

Wow, to think that a change of just a few lines of code can do such amazing things... Thanks das_ricardo, you are amazing. I neglected finishing up one of my sites because I couldn't get this critical feature working, but thanks to you, now I'm motivated to finish what I started. Your work can be seen live at http://discography.by, where I got "Top Rated Artists" & "Top Rated Albums" working easily months ago, but had trouble with "Top Rated Tracks" (which is the one that uses Field Collection) that now works beautifully. Thanks again.

Frank Ralf’s picture

Status: Fixed » Reviewed & tested by the community

Just setting this back to RTBC until it is part of an official release ;-)

torotil’s picture

Thanks for your patch. I'm in favor of simplifying the API.

It has to wait for a 3.x though because it breaks API-compatibility. I hope to release a 3.x-version this year.

Frank Ralf’s picture

Priority: Critical » Normal

Would leaving hook_votingapi_relationships() untouched help keeping API-compatibility so this patch could find its way into 2.x?

BTW: Setting this back to "normal" ;-)

dasRicardo’s picture

Here is a patch for votingapi-7.x-2.9

Kars-T’s picture

Have this in production for months now. Please add this to the module.

torotil’s picture

Status: Reviewed & tested by the community » Fixed

Commited to 7.x-2.x. Thanks a lot for providing the patch and testing.

Kars-T’s picture

Yay Thanks :)

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

edit