From: Eileen McNaughton Date: Mon, 4 Nov 2019 21:01:05 +0000 (+1300) Subject: Merge pull request #15729 from civicrm/5.19 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=73e57781380c5e928082d48d3a7e61ed1f339f78;p=civicrm-core.git Merge pull request #15729 from civicrm/5.19 5.19 to master --- 73e57781380c5e928082d48d3a7e61ed1f339f78 diff --cc CRM/Utils/Migrate/Import.php index 714225da97,d499e65e64..ba779d34c3 --- a/CRM/Utils/Migrate/Import.php +++ b/CRM/Utils/Migrate/Import.php @@@ -364,6 -375,45 +372,28 @@@ AND v.name = % } } + /** + * Get Option Group ID. + * + * Returns an option group's ID, given its name. + * + * @param $groupName + * @param $idMap + * + * @return int|null + */ + private function getOptionGroupIDFromName($groupName, &$idMap) { + if (empty($groupName)) { + return NULL; + } + + if (!isset($idMap['option_group'][$groupName])) { + $idMap['option_group'][$groupName] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $groupName, 'id', 'name'); + } + + return $idMap['option_group'][$groupName]; + } + - /** - * @param $xml - * @param $idMap - */ - public function dbTemplateString(&$xml, &$idMap) { - foreach ($xml->Persistent as $persistentXML) { - foreach ($persistentXML->Persistent as $persistent) { - $persistentObj = new CRM_Core_DAO_Persistent(); - - if ($persistent->is_config == 1) { - $persistent->data = serialize(explode(',', $persistent->data)); - } - $this->copyData($persistentObj, $persistent, TRUE, 'context'); - } - } - } - /** * @param $xml * @param $idMap