Skip to content

Commit

Permalink
CRM-19741: Price set and price set value label fields are inconsistan…
Browse files Browse the repository at this point in the history
…t to users
  • Loading branch information
jitendrapurohit committed Feb 3, 2017
1 parent 0337418 commit 6c08998
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 @@ -102,6 +105,12 @@ public static function create(&$params) {
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();
//html type would be empty in update scenario not sure what would happen ...
Expand Down

0 comments on commit 6c08998

Please sign in to comment.