CRM-15815 fix chaining with sequential
authoreileenmcnaughton <eileen@fuzion.co.nz>
Wed, 5 Aug 2015 09:20:30 +0000 (09:20 +0000)
committereileenmcnaughton <eileen@fuzion.co.nz>
Wed, 5 Aug 2015 10:04:46 +0000 (10:04 +0000)
Civi/API/Subscriber/ChainSubscriber.php

index 944dc71fa01cd1f181a080a0c6fcc789f041aa61..ffc9c9696fc93fdbbc30017b49d77e8f2f6bd882 100644 (file)
@@ -183,7 +183,7 @@ class ChainSubscriber implements EventSubscriberInterface {
             foreach ($newparams as $entityparams) {
               $subParams = array_merge($genericParams, $entityparams);
               _civicrm_api_replace_variables($subParams, $result['values'][$idIndex], $separator);
-              $result['values'][$result['id']][$field][] = $apiKernel->run($subEntity, $subaction, $subParams);
+              $result['values'][$idIndex][$field][] = $apiKernel->run($subEntity, $subaction, $subParams);
               if ($result['is_error'] === 1) {
                 throw new \Exception($subEntity . ' ' . $subaction . 'call failed with' . $result['error_message']);
               }