CiviCRM

Meaningless activity records generated for inherited memberships whenever UpdateMembershipRecord script is run

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed/Completed
  • Affects Version/s: 2.2.8
  • Fix Version/s: 3.2
  • Component/s: CiviMember
  • Labels:
    None

Description

Problem
=========
When UpdateMembership runs, say once a day, it deals with update of inherited memberships by deleting from civicrm_member all inherited memberships, then regenerates them from contact relationships. Each regenerated inherited membership registers a Membership Signup activity in civicrm_activity, even when there is no change in membership or relationship. The database quickly fills with these meaningless activities, making it difficult to use.

Solution
=======
UpdateMembershipRecord already passes a createActivity parameter telling civicrm_contact_membership_create to create an activity record WHEN membership status has changed. Modify the code which handles inherited membership to pay attention to this flag. Desired behavior is that activities are ALSO only created for inherited memberships when their "parent's" membership status has been changed.

Activity

Hide
David Greenberg added a comment -
Hopefully we can prevent this by passing a parameter to the membership create function (assuming that we don't want to redo the basic logic at this time).
Show
David Greenberg added a comment - Hopefully we can prevent this by passing a parameter to the membership create function (assuming that we don't want to redo the basic logic at this time).
Hide
Dharmatech added a comment -
The other possible reason for membership status change is a change in relationship. For example, suppose employees of an organization inherit membership from the organization's membership. If someone becomes an employee of this organization, or leaves the organization, their membership status must be adjusted accordingly. This is currently handled by deleting all inherited memberships then recreating them. This has the undesireable side effect of churning activities and log entries. A more complicated but ultimately more efficient solution would be to change the status of only those inherited memberhips that are actually affected by the change in status.
Show
Dharmatech added a comment - The other possible reason for membership status change is a change in relationship. For example, suppose employees of an organization inherit membership from the organization's membership. If someone becomes an employee of this organization, or leaves the organization, their membership status must be adjusted accordingly. This is currently handled by deleting all inherited memberships then recreating them. This has the undesireable side effect of churning activities and log entries. A more complicated but ultimately more efficient solution would be to change the status of only those inherited memberhips that are actually affected by the change in status.
Hide
Kiran Jagtap added a comment -
We should use existing related membership records rather dropping and create new.
Also do create activity record only when we do create new membership record or we changed status.
Show
Kiran Jagtap added a comment - We should use existing related membership records rather dropping and create new. Also do create activity record only when we do create new membership record or we changed status.
Hide
Kiran Jagtap added a comment -
Show
Kiran Jagtap added a comment - Make sure to test : http://issues.civicrm.org/jira/browse/CRM-6125
Hide
Sushant Paste added a comment -
Tested in r 27500.
Show
Sushant Paste added a comment - Tested in r 27500.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: