Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8429

v2 group api fixed in 32518 to make tests pass but broke ogsync from the looks

    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 )

      { $params['group_type'] = $groupType; }

      $group = civicrm_api('group', 'add', $params );
      $group = civicrm_group_add( $params );
      if ( ! civicrm_error( $group ) )

      { $params['group_id'] = $group['result']; }

      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

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: