CRM-11984 revert d6 OG sync function to use d6 relevant function
authoreileen <eileen@fuzion.co.nz>
Tue, 9 Apr 2013 00:18:26 +0000 (12:18 +1200)
committereileen <eileen@fuzion.co.nz>
Tue, 9 Apr 2013 00:18:26 +0000 (12:18 +1200)
CRM/Utils/System/Drupal6.php

index 451b0f73a95fb002957ffe6db26b789a08f4ffc2..9ccc982b0c56d37253c77cffed17e2e4500fb57e 100644 (file)
@@ -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 );
   }
 
   /**