Test Fix
authorSudha Bisht <sudha.bisht@webaccessglobal.com>
Fri, 12 Jun 2015 13:24:42 +0000 (18:54 +0530)
committerSudha Bisht <sudha.bisht@webaccessglobal.com>
Fri, 12 Jun 2015 13:24:42 +0000 (18:54 +0530)
CRM/Core/BAO/CustomField.php

index c4abb3ccf5b59df20a5c42c7cd2a7e824bcdc57c..506d63edf8250cd957619be0b7cc106d6a658644 100644 (file)
@@ -203,8 +203,8 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
         'table_name'
       );
 
-      //CRM-16659: if option_value then create an option group for the field.
-      if ($params['option_type'] == 1 && !empty($params['option_value'])) {
+      //CRM-16659: if option_value then create an option group for this custom field.
+      if ($params['option_type'] == 1 && (empty($params['option_group_id']) || !empty($params['option_value']))) {
         // first create an option group for this custom group
         $optionGroup = new CRM_Core_DAO_OptionGroup();
         $optionGroup->name = "{$columnName}_" . date('YmdHis');