--CRM-16188, changed code to use contribution_id when retrieving wrt contribution
authorPradeep Nayak <pradpnayak@gmail.com>
Tue, 26 Jan 2016 20:31:19 +0000 (02:01 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Tue, 26 Jan 2016 20:31:19 +0000 (02:01 +0530)
Civi/API/Subscriber/ChainSubscriber.php

index f9f24b4c77ab3690b6d0e280396c214b1824b5a6..46bea118778934adf452557205edfad92e399ed7 100644 (file)
@@ -132,8 +132,10 @@ class ChainSubscriber implements EventSubscriberInterface {
             //'entity_table' will be set to 'contact' & 'id' to the contact id
             //from the parent call. in this case 'contact_id' will also be
             //set to the parent's id
-            $subParams["entity_id"] = $parentAPIValues['id'];
-            $subParams['entity_table'] = 'civicrm_' . $lowercase_entity;
+            if (!($subEntity == 'line_item' && $lowercase_entity == 'contribution' && $action != 'create')) {
+              $subParams["entity_id"] = $parentAPIValues['id'];
+              $subParams['entity_table'] = 'civicrm_' . $lowercase_entity;
+            }
 
             $crm16084 = FALSE;
             if ($subEntity == 'relationship' && $lowercase_entity == 'contact') {