X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FMigrate%2FImport.php;h=dc9e24419ae308b18ed25461a38c41b010c7adba;hb=3f7c098fcb6553d0662b9bbf3df2261244a97aa8;hp=e4124fc92b5398fe223f8d6aceec14d5be7cdd86;hpb=94264777f045154d25cb107ac8f2c92da193a357;p=civicrm-core.git diff --git a/CRM/Utils/Migrate/Import.php b/CRM/Utils/Migrate/Import.php index e4124fc92b..dc9e24419a 100644 --- a/CRM/Utils/Migrate/Import.php +++ b/CRM/Utils/Migrate/Import.php @@ -242,6 +242,15 @@ WHERE v.option_group_id = %1 elseif (in_array($customGroup->extends, array('Individual', 'Organization', 'Household'))) { $valueIDs = $optionValues; } + elseif (in_array($customGroup->extends, array('Contribution', 'ContributionRecur'))) { + $sql = "SELECT id + FROM civicrm_financial_type + WHERE name IN ('{$optValues}')"; + $dao = &CRM_Core_DAO::executeQuery($sql); + while ($dao->fetch()) { + $valueIDs[] = $dao->id; + } + } else { $sql = " SELECT v.value @@ -352,10 +361,10 @@ AND v.name = %1 $fields_indexed_by_group_id[$id][] = $customFieldXML; } } - while (list($group_id, $fields) = each($fields_indexed_by_group_id)) { + foreach ($fields_indexed_by_group_id as $group_id => $fields) { $total = count($fields); $count = 0; - while (list(, $customFieldXML) = each($fields)) { + foreach ($fields as $customFieldXML) { $count++; $customField = new CRM_Core_DAO_CustomField(); $customField->custom_group_id = $group_id;