Skip to content

Commit

Permalink
Merge pull request civicrm#9776 from jitendrapurohit/CRM-19741
Browse files Browse the repository at this point in the history
CRM-19741: Price set and price set value label fields are inconsistan…
  • Loading branch information
yashodha authored Mar 14, 2017
2 parents 339afcd + ff29596 commit e249fda
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CRM/Price/BAO/PriceField.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public static function create(&$params) {
return $priceField;
}

if (!empty($params['id']) && empty($priceField->html_type)) {
$priceField->html_type = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $params['id'], 'html_type');
}
$optionsIds = array();
$maxIndex = CRM_Price_Form_Field::NUM_OPTION;

Expand All @@ -101,6 +104,12 @@ public static function create(&$params) {
// update previous field values( if any )
if ($fieldValue->find(TRUE)) {
$optionsIds['id'] = $fieldValue->id;

//Update price_field_value label when edited inline.
if (!empty($params['id']) && $priceField->label != $fieldValue->label) {
$fieldValue->label = $priceField->label;
$fieldValue->save();
}
}
}
$defaultArray = array();
Expand Down

0 comments on commit e249fda

Please sign in to comment.