CRM-16523 remove last hook by-pass
authoreileenmcnaugton <eileen@fuzion.co.nz>
Tue, 4 Aug 2015 10:50:17 +0000 (22:50 +1200)
committereileenmcnaugton <eileen@fuzion.co.nz>
Tue, 4 Aug 2015 18:16:08 +0000 (06:16 +1200)
CRM/Contribute/BAO/Contribution.php

index f59cbe4794f05857fe0f1caeb8cac5947a5bcd43..6b6edcdb1fd0ef72dfbea1554856f5190e59ceba 100644 (file)
@@ -4015,7 +4015,7 @@ WHERE con.id = {$contributionId}
       'check_number',
       'payment_instrument_id',
       'is_test',
-      'campaign_id'
+      'campaign_id',
     );
 
     $contributionParams = array_merge(array(
@@ -4181,14 +4181,11 @@ LIMIT 1;";
         $contributionParams['receipt_date'] = $changeDate;
         $values['is_email_receipt'] = 1;
       }
+      $participantParams['id'] = $participant->id;
       if (empty($input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'])) {
-        $participantStatuses = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'status_id', array(
-          'labelColumn' => 'name',
-          'flip' => 1,
-        ));
-        $participant->status_id = $participantStatuses['Registered'];
+        $participantParams['status_id'] = 'Registered';
       }
-      $participant->save();
+      civicrm_api3('Participant', 'create', $participantParams);
     }
 
     $contributionParams['id'] = $contribution->id;