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 (Moderator: Dave Greenberg) »
  • CiviGroup Roles Sync - possible to make the syncing one-directional?
Pages: [1]

Author Topic: CiviGroup Roles Sync - possible to make the syncing one-directional?  (Read 1358 times)

stuart

  • I post occasionally
  • **
  • Posts: 41
  • Karma: 0
  • CiviCRM version: 4.2.7
  • CMS version: Drupal 6
  • MySQL version: 5.0.77
  • PHP version: 5.3
CiviGroup Roles Sync - possible to make the syncing one-directional?
September 27, 2012, 01:57:53 am
We're using CiviGroup Roles Sync to synchronize our Civi Groups to Drupal Roles. We've encountered a problem however - the synchronizing seems bi-directional, and as we have several groups for each role this isn't desirable.

Our settings are like this:


Group <--> Role
Group 1 <--> Role 1
Group 2 <--> Role 1
Group 3 <--> Role 2

If someone is in Group 1 and logs in, they get assigned role 1. But then the module seems to notice they're in Role 1, and adds them to Group 2!

Is there any way to make the synchronizing just work in a single direction rather than bi-directional?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: CiviGroup Roles Sync - possible to make the syncing one-directional?
September 27, 2012, 04:12:42 am
I think you would have to customize the PHP file that does this and comment out that one direction of the synchronization.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

stuart

  • I post occasionally
  • **
  • Posts: 41
  • Karma: 0
  • CiviCRM version: 4.2.7
  • CMS version: Drupal 6
  • MySQL version: 5.0.77
  • PHP version: 5.3
Re: CiviGroup Roles Sync - possible to make the syncing one-directional?
September 27, 2012, 04:17:24 am
In the end I edited the file:
sites/all/modules/civicrm/drupal/modules/civicrm_group_roles/civicrm_group_roles.module

And commented out the contents of the "civicrm_group_roles_add_remove_groups" function to make it uni-directional syncing.

Ideally this would be patched properly and configurable via the UI, I don't know if this has already been done in the latest stable Civi however, we're behind in upgrading. I tried to look on the demo site but that doesn't show the Drupal bits.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: CiviGroup Roles Sync - possible to make the syncing one-directional?
September 27, 2012, 04:19:15 am
Quote from: stuart on September 27, 2012, 04:17:24 am
Ideally this would be patched properly and configurable via the UI, I don't know if this has already been done in the latest stable Civi however, we're behind in upgrading.

Actually I myself don't recall anyone else asking for this feature. It doesn't exist yet and I'm not sure it will be added. Perhaps if other also expressed interest however...
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

stuart

  • I post occasionally
  • **
  • Posts: 41
  • Karma: 0
  • CiviCRM version: 4.2.7
  • CMS version: Drupal 6
  • MySQL version: 5.0.77
  • PHP version: 5.3
Re: CiviGroup Roles Sync - possible to make the syncing one-directional?
September 27, 2012, 06:32:10 am
Quote from: Hershel on September 27, 2012, 04:19:15 am
Actually I myself don't recall anyone else asking for this feature. It doesn't exist yet and I'm not sure it will be added. Perhaps if other also expressed interest however...

Two other people were confused by the same thing when I was searching before:
http://forum.civicrm.org/index.php?topic=11701.0
http://forum.civicrm.org/index.php?topic=26046.0

Just seems a bit odd that the member sync is one way, but the group sync bi-directional. I guess the original author desired that behaviour. I wasn't proposing that core developers work on this, more absent-mindedly wishing I had the time myself to write a patch.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: CiviGroup Roles Sync - possible to make the syncing one-directional?
September 27, 2012, 08:16:11 am
This is news to me that this is bi-directional - hmm - wonders what oddness this has been creating that never got spotted
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

magdmartin

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: CiviCRM4.2
  • CMS version: Drupal
  • MySQL version: 5.5
  • PHP version: &
Re: CiviGroup Roles Sync - possible to make the syncing one-directional?
December 19, 2012, 09:55:48 am
I'm supporting stuart's request to have the option to set the sync only in one direction.

In a current installation, we have both CiviCRM OG sync and CiviGroup Role sync in this settings: User added to OG > sync with CiviCRM Group > sync with Drupal Role. This works well when adding a user to an OG but there is a "conflict" between the two sync when removing a user from an OG.

This is due to the fact that CiviGroup role sync operate a two way sync, so every time CiviCRM OG sync remove an user from a CiviCRM Group, the CiviGroup role sync module add back the user to CiviCRM group instead of removing its role permission in Drupal:

Having the ability to set CiviGroup role sync in one way (from CiviCRM group to Drupal role) will help a lot in this case.

Thanks

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • CiviGroup Roles Sync - possible to make the syncing one-directional?

This forum was archived on 2017-11-26.