Fix for custom field edit
authorSudha Bisht <sudha.bisht@webaccessglobal.com>
Fri, 12 Jun 2015 09:50:35 +0000 (15:20 +0530)
committerSudha Bisht <sudha.bisht@webaccessglobal.com>
Fri, 12 Jun 2015 09:50:35 +0000 (15:20 +0530)
CRM/Core/BAO/CustomField.php

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