From: eileen Date: Tue, 9 Apr 2013 00:18:26 +0000 (+1200) Subject: CRM-11984 revert d6 OG sync function to use d6 relevant function X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d761c4d8213c201866141108c37a62bd3ea0c787;p=civicrm-core.git CRM-11984 revert d6 OG sync function to use d6 relevant function --- diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php index 451b0f73a9..9ccc982b0c 100644 --- a/CRM/Utils/System/Drupal6.php +++ b/CRM/Utils/System/Drupal6.php @@ -906,22 +906,24 @@ SELECT name, mail return $loginURL; } - /* + /** * Wrapper for og_membership creation + * + * @param integer $ogID Organic Group ID + * @param integer $drupalID drupal User ID */ function og_membership_create($ogID, $drupalID){ - $group_membership = og_membership_create($ogID, 'user', $drupalID, array('is_active' => 1)); - $group_membership->save(); + og_save_subscription( $ogID, $drupalID, array( 'is_active' => 1 ) ); } /** * Wrapper for og_membership deletion + * + * @param integer $ogID Organic Group ID + * @param integer $drupalID drupal User ID */ function og_membership_delete($ogID, $drupalID) { - $membership = og_get_group_membership($ogID, 'user', $drupalID); - if ($membership) { - og_membership_delete($membership->id); - } + og_delete_subscription( $ogID, $drupalID ); } /**