CRM-12997. Set id on all line items, not just the first.
authorChris Burgess <chris@giantrobot.co.nz>
Tue, 2 Jul 2013 05:11:30 +0000 (17:11 +1200)
committerChris Burgess <chris@giantrobot.co.nz>
Tue, 2 Jul 2013 05:11:30 +0000 (17:11 +1200)
CRM/Contribute/Form/Contribution.php

index e6569faf6194d822d5348b33da61ef7e0f9c903e..2c33cd62be0f216b29236ef7909bb0004e77e156 100644 (file)
@@ -1062,13 +1062,15 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
       }
 
       $lineItems = CRM_Price_BAO_LineItem::getLineItems($entityID, $entityTable);
+      foreach (array_keys($lineItems) as $id) {
+        $lineItems[$id]['id'] = $id;
+      }
       $itemId = key($lineItems);
       $fieldType = NULL;
       if ($itemId && CRM_Utils_Array::value('price_field_id', $lineItems[$itemId])) {
         $fieldType = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $lineItems[$itemId]['price_field_id'], 'html_type');
       }
       $lineItems[$itemId]['unit_price'] = $lineItems[$itemId]['line_total'] = CRM_Utils_Rule::cleanMoney(CRM_Utils_Array::value('total_amount', $submittedValues));
-      $lineItems[$itemId]['id'] = $itemId;
       // 10117 update th line items for participants
       $this->_priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $lineItems[$itemId]['price_field_id'], 'price_set_id');
       $lineItem[$this->_priceSetId] = $lineItems;