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) »
  • Current & Expired status causes conflict with CiviMember Roles Sync
Pages: [1]

Author Topic: Current & Expired status causes conflict with CiviMember Roles Sync  (Read 1352 times)

joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Current & Expired status causes conflict with CiviMember Roles Sync
October 19, 2010, 09:03:38 am
I'm experiencing a problem with individuals maintaining (Drupal Role) "Member" status when they have both a current and expired membership in CiviCRM (CiviMember).

Background:
Membership is by Organization -> extended to Individuals based on relationship
CiviGroup Roles Sync and CiviMember Roles Sync both enabled

If an individual has both an expired and current membership in CiviCRM, the Drupal Role (Member) is removed during CiviMember Roles Sync. The membership (current and expired) is retained in CiviCRM, but the role is deleted in Drupal.
--
Joe

joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Current & Expired status causes conflict with CiviMember Roles Sync
October 20, 2010, 09:46:19 pm
After some searching...it looks like this was fixed in 3.0.2
http://forum.civicrm.org/index.php?topic=10483.0;wap2

...but is back as an issue in the current version.
--
Joe

AudreyKate

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 1
  • CiviCRM version: 3.4.4
  • CMS version: Drupal 6.24
Re: Current & Expired status causes conflict with CiviMember Roles Sync
February 07, 2011, 07:39:41 pm
I'm having the same problem -- was there any update on this. I've looked at the patch on the linked page and don't see how I could apply it to the current module.... I'm running 3.2.5.

If it helps, this is only happening when contacts have a current and an expired membership of the same type. When they have an expired student membership and a current individual membership, for instance, things seem to be working fine. But when both current and expired memberships are individual memberships, Drupal removes the role.

Thanks!

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Current & Expired status causes conflict with CiviMember Roles Sync
February 11, 2011, 05:36:17 pm
I am having the same problem in 3.2.5.  I ran a test to be sure.  I gave myself a current membership in civi, ran the sync, and it gave me the corresponding drupal role.  I then added an expired membership of the same type in Civi, ran the sync, and it removed the corresponding drupal role.  So, if current and expired memberships co-exist, expired wins. 

I see that this was addressed as an issue (http://forum.civicrm.org/index.php/topic,10483.0/wap2.html) and see that I was a part of this discussion thread.  Is this being addressed in 3.2.5 and if so, where?  This is a fairly serious problem for my site since members can only see their full information on the drupal side if it syncs with the civi side, where they have little to no access.

I can test if someone gives clear instructions on how to do so.

Thanks,
Maria

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Current & Expired status causes conflict with CiviMember Roles Sync
February 11, 2011, 06:36:56 pm
I have, I think, fixed the issue.  It requires applying the patch created for 3.2.3, at http://issues.civicrm.org/jira/browse/CRM-7041.

Code: [Select]
--- orig 2010-11-05 16:19:31.000000000 -0600
+++ new 2010-11-05 16:19:31.000000000 -0600
@@ -510,8 +510,8 @@ function _civicrm_member_roles_sync($ext
             if ( $removeRule ) $expiredRoleIds[$rid] = $rid;
         }
         //Apply roles.
- foreach ( $currentRoleIds as $role ) user_multiple_role_edit($addAccount, 'add_role', $role);
         foreach ( $expiredRoleIds as $role ) user_multiple_role_edit($removeAccount, 'remove_role', $role);
+ foreach ( $currentRoleIds as $role ) user_multiple_role_edit($addAccount, 'add_role', $role);
     }
     return TRUE;
 }

Can this be applied to the core?  It is a simple switch in the order of role application so add follows remove rather than the other way around.

Maria

AudreyKate

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 1
  • CiviCRM version: 3.4.4
  • CMS version: Drupal 6.24
Re: Current & Expired status causes conflict with CiviMember Roles Sync
February 12, 2011, 11:46:18 pm
Thanks for this, Maria! I'll test it on my site as well; looks like it will solve the problem!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Current & Expired status causes conflict with CiviMember Roles Sync

This forum was archived on 2017-11-26.