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 Drupal Modules (Moderator: Donald Lobo) »
  • civimember roles sync
Pages: [1]

Author Topic: civimember roles sync  (Read 4766 times)

bpayst

  • I’m new here
  • *
  • Posts: 16
  • Karma: 3
civimember roles sync
October 22, 2009, 08:52:01 pm
Civimember Roles Sync appears to be acting oddly. The Drupal permissions page for the module shows no options for granting permissions for the module.

I have 2 cases where the correct Drupal role is removed after running a manual synchronization. In both of these cases, the users have an expired membership from an import and a current membership.If I have "expired" as a status in Expired Codes, the Drupal role is removed from the user, eventhough they have a current membership.

 If I remove "expired" as a status from the Expired Codes the Drupal role remains. It looks like maybe the  current membership is not getting priority?

This is Drupal 6.14 and CiviCRM 3.0.1


Thanks.
« Last Edit: October 22, 2009, 08:58:20 pm by bpayst »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: civimember roles sync
October 24, 2009, 07:40:08 am

hey bpayst:

if you are skilled at PHP, would be great if you can help isolate and debug this bug

the code is at: drupal/modules/civicrm_member_roles/civicrm_member_roles.module

can u try the following patch:

Code: [Select]
Index: drupal/modules/civicrm_member_roles/civicrm_member_roles.module
===================================================================
--- drupal/modules/civicrm_member_roles/civicrm_member_roles.module     (revision 24495)
+++ drupal/modules/civicrm_member_roles/civicrm_member_roles.module     (working copy)
@@ -441,7 +441,11 @@
         }

         unset($dao);
-
+
+       // also make sure the add has precedence over remove, i.e. if we add a role, we dont remove it
+       // in case of multiple membership types
+       $remove_accounts = array_diff( $remove_accounts, $add_accounts );
+
         //Let's make sure the rid is really an rid.
         if(is_numeric($result->rid)) {

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

bpayst

  • I’m new here
  • *
  • Posts: 16
  • Karma: 3
Re: civimember roles sync
October 26, 2009, 06:37:20 am
Thanks. I'll put that code in and give it a try. I'm not up to coding that myself, but I can run test cases.

Let me take a moment to that the CiviCRM team, it's a fantastic project that I've just started to put to all kinds of great and cool uses. I really appreciate all the hard work that has gone into CiviCRM.

Brian

bpayst

  • I’m new here
  • *
  • Posts: 16
  • Karma: 3
Re: civimember roles sync
November 03, 2009, 08:14:00 am
Sorry it took so long to get back to you. It looks like this patch fixed the problem. Users with multiple memberships (current and expired) are correctly being added to the right Drupal group.

Many thanks!

Brian

johnbarclay

  • I’m new here
  • *
  • Posts: 5
  • Karma: 1
Re: civimember roles sync
November 14, 2009, 09:10:02 pm
this patch is in civicrm 3.0.2 now.

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: civimember roles sync
December 22, 2009, 08:14:22 pm
I added the patch to 2.2.9, works there too. 

But I have a question:

I have two drupal roles: Current Member, Former Member. 

The goal is that contacts whose membership statys is 'current, new, grace, pending' are given the "Current Member" role.
contacts who have expired memberships are "Former Members."

These two rules apparently conflict with one another when a contact has both expired memberships, and a current member.  Is there a way to write a rule which prioritizes the most recent membership?

Thanks,
Maria

websynapse

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 3
    • Ryan Kennedy
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 6
Re: civimember roles sync
April 12, 2010, 07:54:17 pm
Did the patch fix the problem with the permissions not appearing?

bpayst

  • I’m new here
  • *
  • Posts: 16
  • Karma: 3
Re: civimember roles sync
April 20, 2010, 06:19:50 pm
Quote from: websynapse on April 12, 2010, 07:54:17 pm
Did the patch fix the problem with the permissions not appearing?
yes, it did for me and this fix is in the current release. I am currently tracking one user who is still showing this same problem, but he is the only one who has reported it so not sure what the cause is there.

websynapse

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 3
    • Ryan Kennedy
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 6
Re: civimember roles sync
April 20, 2010, 10:08:30 pm
Quote from: johnbarclay on November 14, 2009, 09:10:02 pm
this patch is in civicrm 3.0.2 now.

Does this mean it should work without the patch in upgrades or installs post 3.0.2? Or does it need the patch?

We've upgraded to 3.1.3 and the civicrm_member_roles module permission box is still not there. I've uninstalled and re-enabled the module and that didn't work.

bpayst

  • I’m new here
  • *
  • Posts: 16
  • Karma: 3
Re: civimember roles sync
April 28, 2010, 06:25:44 am
The permissions never seem to show up, but the module is there. Look under Site Configuration and you should see a CiviCRM Member Roles Sync.

websynapse

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 3
    • Ryan Kennedy
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 6
Re: civimember roles sync
April 28, 2010, 02:15:27 pm
I would much prefer to be able to see who has permissions to administer it. Why is it listed there if the box is hidden? This seems half-finished.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: civimember roles sync
April 28, 2010, 05:07:36 pm

would be great if you can investigate and/or sponsor a developer to complete the work

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • civimember roles sync

This forum was archived on 2017-11-26.