Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.4
-
Fix Version/s: 3.4.5
-
Component/s: None
-
Labels:None
Description
We've been seeing ACL roles not being created by og_sync in combination with this error
Object of class CRM_Contact_BAO_Group could not be converted to int Notice DataObject.php
I finally tracked it down to commit 32518 which changed the output of the v2 api function to return an object instead of an id.
This is causing problems in the function below which is now setting $params['group_id'] to be an object rather than an id.
CRM_Bridge_OG_Drupal
static function updateCiviGroup( &$params, $op, $groupType = null ) {
$abort = ( $op == 'delete' ) ? true : false;
$params['id'] = CRM_Bridge_OG_Utils::groupID( $params['source'], $params['title'], $abort );
if ( $op == 'add' ) {
require_once 'api/v2/Group.php';
if ( $groupType )
$group = civicrm_api('group', 'add', $params );
$group = civicrm_group_add( $params );
if ( ! civicrm_error( $group ) )
My preferred approach would be to revert the api to original behaviour or to add handing if(is_a($object,'CRM_Contact_BAO_Group') in the function above. It could use v3 api but I'm not keen on upgrading it right at the moment. I'd rather just get it work as it used to