Skip to content

Commit

Permalink
CRM-17410: Using xml on upgrade (not installation) of extension to cr…
Browse files Browse the repository at this point in the history
…eate/append new optionvalues
  • Loading branch information
jitendrapurohit committed Dec 14, 2016
1 parent c14f0ef commit 24f4fd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CRM/Utils/Migrate/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ public function optionValues(&$xml, &$idMap) {
foreach ($optionValuesXML->OptionValue as $optionValueXML) {
$optionValue = new CRM_Core_DAO_OptionValue();
$optionValue->option_group_id = $idMap['option_group'][(string ) $optionValueXML->option_group_name];
if (empty($optionValue->option_group_id)) {
//CRM-17410 check if option group already exist.
$optionValue->option_group_id = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $optionValueXML->option_group_name, 'id', 'name');
}
$this->copyData($optionValue, $optionValueXML, FALSE, 'label');
if (!isset($optionValue->value)) {
$sql = "
Expand Down

0 comments on commit 24f4fd7

Please sign in to comment.