From: Eileen McNaughton Date: Thu, 10 Jul 2014 21:50:41 +0000 (+1200) Subject: fix enotice on priceset update X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=69d6212888629dec15d4accba3fa366b2f52345a;p=civicrm-core.git fix enotice on priceset update --- diff --git a/CRM/Price/BAO/PriceFieldValue.php b/CRM/Price/BAO/PriceFieldValue.php index d53f27a185..c3e0a7d7ea 100644 --- a/CRM/Price/BAO/PriceFieldValue.php +++ b/CRM/Price/BAO/PriceFieldValue.php @@ -88,7 +88,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { $params['name'] = strtolower(CRM_Utils_String::munge($params['label'], '_', 242)); } - if ($id = CRM_Utils_Array::value('id', $ids)) { + if ($id = CRM_Utils_Array::value('id', $ids) && !empty($params['weight'])) { if (isset($params['name']))unset($params['name']); $oldWeight = NULL; @@ -100,7 +100,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { $params['weight'] = CRM_Utils_Weight::updateOtherWeights('CRM_Price_DAO_PriceFieldValue', $oldWeight, $params['weight'], $fieldValues); } else { - if (empty($params['name'])) { + if (!$id && empty($params['name'])) { $params['name'] = CRM_Utils_String::munge(CRM_Utils_Array::value('label', $params), '_', 64); } if (empty($params['weight'])) {