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) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Shared Membership bidirectional and multiple Relationships
Pages: [1]

Author Topic: Shared Membership bidirectional and multiple Relationships  (Read 1090 times)

Rick Cunningham

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 3
    • Landings Men's Golf Association
  • CiviCRM version: 4.5.7
  • CMS version: Drupal 7.34
Shared Membership bidirectional and multiple Relationships
March 10, 2011, 08:20:31 am
I'm very excited to find that in CiviCRM 3.3.3 I can set up a membership type and can choose multiple relationships from the pulldown. I started with choosing both "Household Member Is" and "Household Member Of" and then gave a membership to a person A, who was a member of household 1. Not only did the membership propagate up to the household, which now is "Family (by relationship)", but in addition, it propagated back down to Persons B and C, who were also household members. So 1 membership and 3 "by relationship" memberships were created by the single action.

To test just how far this would go, I created a new membership type with the relationship field set to all of the following household relationships: Child of, Head of Household for, Head of Household is, Household Member is, Household Member of, Parent of, Sibling of, Spouse of. I revoked the membership above and gave one of the household members one of these new memberships. Once again all three household members, plus the household were credited with a membership. When I added two more contacts, a child of one of the members and a sibling of that new child, two more memberships "by relationship" were added, even though that last child was "five degrees of separation" from the primary member. This is FANTASTIC and seems to be the answer to many of the problems with households that we've been struggling with as we try to flesh out a test system to determine how we will use Drupal/Civi.

HOWEVER, I find that if I want to change the relationships(s) for a particular membership type, the edit form only LISTS the relationship(s) I initially set, and no longer has a pull down to choose different or more relationships.

I'm worried that the only way to add or change the relationships is to delete the membership type, and create a new one. I'm sure that would create havoc, so I'm a bit nervous about using this great capability.

Anyone know whether it will be possible to edit and modify the relationships field in a membership type in the future? I wonder if I could legitimately edit the SQL membership type table, but that's really beyond my knowledge level and I don't know what I might be breaking.




Rick Cunningham

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 3
    • Landings Men's Golf Association
  • CiviCRM version: 4.5.7
  • CMS version: Drupal 7.34
Re: Shared Membership bidirectional and multiple Relationships
March 10, 2011, 10:11:03 am
If anyone wants to see this in action, I just used the test site

drupal dot demo dot civicrm dot org

and added a SuperTestHousehold membership category, then gave Ann Patel said membership. It immediately propagated this membership to the household (Bill Patel's Home) and then to three other members of that household.

Look at membership/find members/ and choose SuperTestHouseholds as search criterion.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Shared Membership bidirectional and multiple Relationships
March 10, 2011, 12:10:27 pm
Rick - We don't currently support changing the "inheritance rules" for a membership type once there are one or more memberships added for that type. The main reason is that any modification to the list of inherited relationship types would also require:

* scanning all existing memberships to see which "by relationship" memberships are no longer valid, and then expiring or removing them
* scanning all relationships of the added relationship type(s) to see what memberships need to be created to meet the new rules

Obviously this is possible, but non-trivial - so I assume folks using this feature currently are trying to plan comprehensively up front for what relationships they want to support (and perhaps adding another membership type later if needed to support additional relationships).

If being able to modify this property is critical for your organization / use cases perhaps you can contribute a patch for this.
Protect your investment in CiviCRM by  becoming a Member!

Rick Cunningham

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 3
    • Landings Men's Golf Association
  • CiviCRM version: 4.5.7
  • CMS version: Drupal 7.34
Re: Shared Membership bidirectional and multiple Relationships
March 11, 2011, 04:30:11 am
Dave, thanks for the reply re: changing membership categories. I'm very new to this, but your explanation was clear. Perhaps I can ask a couple of specific questions, then see if I can develop a patch after I get some competence and confidence under my belt.

A. Apparently these relational memberships are only addressed AS a single primary membership is added, removed, or otherwise changed. The primary is changed, and then a (recursive?) process identifies and sets memberships for each of the related individuals. True? (Also, when a relationship is changed for a person, his new chain of relationships is scanned to add or remove relational memberships)

B. If I delete a particular membership category, all the primary and secondary memberships are removed (does this take care of the first task above in your reply? "scanning all existing memberships to see which "by relationship" memberships are no longer valid, and then expiring or removing them"? If I make a group of all the people with this membership, or maybe save all the primary membership events of this category (somehow) am I part of the way towards the second step?

C. I can then add back the same membership category as a new category, with all the same info, but with a different set of desired relationships. and then...

D. I'm not sure I know how to do this, but if I can batch add the "primary relationship events" that were automatically deleted in step B, then as each one is added, the second step will automatically occur "scanning all relationships of the added relationship type(s) to see what memberships need to be created to meet the new rules".

So a partially manual method would involve:
Export all "primary membership events" of the type we want to modify.
Delete said membership category
Define a new membership with same name, etc., but new desired relationships
Import all "primary membership events" to reinstate the deleted memberships.

Obviously, I'm a bit confused about what means "primary membership events", but does this sound like it's on the right track?

Rick Cunningham

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 3
    • Landings Men's Golf Association
  • CiviCRM version: 4.5.7
  • CMS version: Drupal 7.34
Re: Shared Membership bidirectional and multiple Relationships
March 11, 2011, 04:38:03 am
I just recalled one thing that I believe I found to be true. In some small tests, I found that I wasn't permitted to delete a membership category if there were any instances of that membership category in the database. I had to manually delete each of the membership events BEFORE deleting the membership. So I am apparently wrong about "automating" the first step by merely deleting the membership category. Am I right about being wrong on this?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Shared Membership bidirectional and multiple Relationships
March 11, 2011, 02:44:27 pm
Rick - In terms of a manual process I think you're on the right track. Test out the following steps:

Search for "Primary Members Only" in Find Members selecting the Membership Type you want to modify
Export those memberships
Search for "All Members" in Find Members selecting the Membership Type you want to modify
Delete all those memberships
Delete that Membership Type (Administer > CiviMember > Membership Types
Define a new membership type with same name, etc., but new desired relationships
Import the "primary memberships" you exported above reinstate the deleted memberships.

NOTE: Not 100% sure the Import Membership task will reinstate the inherited relationships - it should though. If not, I think running the UpdateMembershipRecord.php script (located in bin directory) will do that. You need to run that script regularly via a cron job in any case to keep your membership statuses updated and send renewal notices.

Please post back w/ your testing results on the above (and potentially add some documentation to the wiki on this "work-around").
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Shared Membership bidirectional and multiple Relationships

This forum was archived on 2017-11-26.