Ensure that price_field_value rows aren't duplicated when editing price field of...
authorSeamus Lee <seamuslee001@gmail.com>
Thu, 26 Sep 2019 09:04:57 +0000 (19:04 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Thu, 26 Sep 2019 09:04:57 +0000 (19:04 +1000)
CRM/Price/BAO/PriceField.php

index b3d03a613913615a9926a8b8e8335d8f7884d886..1020c6009a563536d9f40d928891d996a3cfdf42 100644 (file)
@@ -116,6 +116,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
       ]);
       foreach ($fieldOptions['values'] as $option) {
         $optionsIds['id'] = $option['id'];
+        $params['option_id'] = [1 => $option['id']];
         // CRM-19741 If we are dealing with price fields that are Text only set the field value label to match
         if (!empty($params['id']) && $priceField->label != $option['label']) {
           $fieldValue = new CRM_Price_DAO_PriceFieldValue();