From: Eileen McNaughton Date: Mon, 9 Jun 2014 14:10:19 +0000 (+1200) Subject: CRM-14824 fix intemittant bug on priceset processing X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=be45c8b4a86fb6cb2e590f9a7f39211498251b3f;p=civicrm-core.git CRM-14824 fix intemittant bug on priceset processing --- diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 1c4ed9675a..621f2aac28 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -658,9 +658,10 @@ WHERE id = %1"; switch ($field['html_type']) { case 'Text': - $params["price_{$id}"] = array(key($field['options']) => $params["price_{$id}"]); + $firstOption = reset($field['options']); + $params["price_{$id}"] = array($firstOption['id'] => $params["price_{$id}"]); CRM_Price_BAO_LineItem::format($id, $params, $field, $lineItem); - $totalPrice += $lineItem[key($field['options'])]['line_total']; + $totalPrice += $lineItem[$firstOption['id']]['line_total']; break; case 'Radio':