I'm trying to create a view of users and list the users' related Redhen Contact and Membership. The only relationships available in views to the Drupal user account are to the related Contact's AUTHOR, related Membership's AUTHOR, related Organization's AUTHOR. This doesn't make much sense to me. I'm assuming, it's supposed to be the the actual related Contact, Membership, or Organization, not the author of the information. Any chance on making the Contact, Membership, and Organization data available in a view of Drupal user accounts?

Thanks,
Mickey

Comments

tauno’s picture

Title: Views relationships » Views relationship for contact/drupal user should be added
Project: RedHen Membership » RedHen CRM
Component: Code » redhen_contact
Category: bug » feature

This is missing in redhen_contact since we moved to storing the drupal user connection in a different table. Need to either implement our own views relationship handler or figure out if there's a cleaner way within the entityPropertyInfo definitions.

tauno’s picture

Status: Active » Fixed

Added in commit 45c79f1 using joins. We may need to consider using a relationship instead of this is too rigid.

micnap’s picture

Yayyyyy!!!! Thank you!!!!

Mickey

Status: Fixed » Closed (fixed)

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

visuaLatte’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta3
Category: feature » bug

I've installed RedHen beta3, and it's still not quite working correctly.

What I can do:
I can add a Views field of 'User: UID', 'User: Name', or other core User attributes without needing the Author_UID relationship. So this part works.

What still seems to be missing:
I can't add User fields (i.e. custom fields I've added to each User, such as a 'First Name' field) to Views without using the Author_UID relationship.

visuaLatte’s picture

Status: Closed (fixed) » Active

Re-opened, sorry, forgot the first time.

visuaLatte’s picture

My team member has written a patch to add a Views Relationship from RedHen Contact to User.

We'll post a patch here.

marktfrey’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new2.11 KB

This ^. I was able to access some user fields through the join, but could not establish any relationships other than the relationship on author_uid. Attached patch adds relationships from redhen_contact -> user and vice versa.

seanberto’s picture

Assigned: Unassigned » tauno

Assigning to Tauno, who's on vacation this week. FYI, we're sprinting on a big custom (and private) Drupal/RedHen/Salesforce distribution for a client the next two weeks. It's leading to a lot of bug fixes and enhancements, but it's got us a bit backed up on the issue queue. Thank you for your patience. Mark and Nate and Mickey, we definitely value your input, patches and documentation. Thank you so much for partnering with us!

tauno’s picture

Seems like we could remove a couple of the join definitions and just rely on the relationships instead. Does this slightly tweaked patch work for you all?

tauno’s picture

Status: Needs review » Fixed

Added in commit 690a286. Thanks for the patch marktfrey!

Status: Fixed » Closed (fixed)

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

  • Commit 45c79f1 on 7.x-1.x, tests, redhen-donation by tauno:
    Issue #1757574: Define Views join for active Drupal user/contact
    
  • Commit 690a286 on 7.x-1.x, tests, redhen-donation authored by marktfrey, committed by tauno:
    Issue #1757574 by marktfrey: Added views relationship for contact/user....

  • Commit 45c79f1 on 7.x-1.x, tests, redhen-donation, relation-roles by tauno:
    Issue #1757574: Define Views join for active Drupal user/contact
    
  • Commit 690a286 on 7.x-1.x, tests, redhen-donation, relation-roles authored by marktfrey, committed by tauno:
    Issue #1757574 by marktfrey: Added views relationship for contact/user....