CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm_member_roles sync for related permissioned contacts of member orgs
Pages: [1]

Author Topic: civicrm_member_roles sync for related permissioned contacts of member orgs  (Read 1580 times)

tmcnulty1982

  • Guest
civicrm_member_roles sync for related permissioned contacts of member orgs
December 11, 2008, 11:32:23 am
We needed a way to grant contacts of our members a way to login to the site and access members-only content.  The civicrm_member_roles module goes part of the way in that it syncs up individual members with specific drupal roles.

I've modified civicrm_member_roles to do the same thing for permissioned contacts of member organizations.  See the attached patch and post any questions or comments...it could clearly be improved (e.g., with a config option to turn this feature on or off).

toby


davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: civicrm_member_roles sync for related permissioned contacts of member orgs
February 18, 2009, 06:45:46 am
Tested and working here, good contribution, thanks!

I thought I'd found a problem with it: some users were not getting a role allocated, even though the relevant relationships and memberships were in place. I tracked it down to incorrect entries in the civicrm_uf_match table: for the users in question, civicrm_uf_match had the contact_id of an Organization that was related to the Individual whose contact_id should have been there. The Organization and Individual in question had consecutive ids, having been created via a membership contribution on behalf of an org.

Am I right in saying this should never happen, since the Org as user hack was banished?

I manually deleted the incorrect civicrm_uf_match entry then logged in as the relevant user, this created a new civicrm_uf_match entry but this time with the correct contact_id, namely the Individual's.

If someone can confirm that this is unintended behaviour, I'll try to find a way to replicate.

Thanks,

Dave J

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: civicrm_member_roles sync for related permissioned contacts of member orgs
February 18, 2009, 11:55:45 am
Hi Dave - Yes, organization AS user 'hack' has been banished and the linkage should not happen in current codebase (2.1 and later). If you an recreate - do file an issue. Thx!
Protect your investment in CiviCRM by  becoming a Member!

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: civicrm_member_roles sync for related permissioned contacts of member orgs
February 19, 2009, 06:08:56 am
Quote from: Dave Greenberg on February 18, 2009, 11:55:45 am
Yes, organization AS user 'hack' has been banished and the linkage should not happen in current codebase (2.1 and later). If you an recreate - do file an issue. Thx!

Issue created: CRM-4151

Dave J

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm_member_roles sync for related permissioned contacts of member orgs

This forum was archived on 2017-11-26.