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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviCRM OG Sync issue
Pages: [1]

Author Topic: CiviCRM OG Sync issue  (Read 1431 times)

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
CiviCRM OG Sync issue
July 04, 2008, 06:06:47 pm
I kept getting a CiviCRM fatal error when adding or deleting a user from an organic group with CiviCRM OG Sync enabled using CiviCRM 2.0.2.

The attached patch for CRM/Bridge/OG/Utils.php created with svn diff against head should fix that.

I also used the Drupal username to provide a first and possibly last name when creating CiviCRM accounts. This isn't necessarily a good practice, so feel free to remove it.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

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: CiviCRM OG Sync issue
July 04, 2008, 06:40:41 pm

made the fix in trunk

thanx for the patch

lobo

p.s> i did not include the first/last name code
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: CiviCRM OG Sync issue
July 04, 2008, 08:03:01 pm
Great.

I'm now looking at the code that updates og membership when group membership is changed.

I have some attached some patches (CRM/Bridge/OG/Utils.php, drupal/civicrm_og_sync.module) that seem to handle things going the other way: user changes in CiviCRM causing updates to Drupal OG membership, but only for the normal and not yet the acl group in CiviCRM.

I think it may need to be expanded to handle acl stuff properly as follows:
  • check the current user has the appropriate permissions on the Drupal side to either add/delete members, or add/delete admins
  • if the civicrm is an acl group_type 1, then make sure there are other admins in Drupal group before allowing a delete. May need to look after making someone else a manager too.
  • if the civicrm group is an ordinary group_type 2, then check if the uid to be deleted is an admin first, and if so , follow approach in 2, otherwise just unsubscribe the user from the group

Anything else come to mind?

I'm going to be busy for the next week at least, but thought I'd throw this out for comment and in case anyone else wanted to pick it up.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviCRM OG Sync issue

This forum was archived on 2017-11-26.