Fixed bug https://github.com/civicrm/civicrm-core/pull/1206#issuecomment-21285959
authormmikitka <matt@mikitka.net>
Fri, 9 Aug 2013 04:00:48 +0000 (00:00 -0400)
committermmikitka <matt@mikitka.net>
Fri, 9 Aug 2013 04:00:48 +0000 (00:00 -0400)
CRM/Core/BAO/CustomField.php

index 77e306f909776fdc7c7a69663d24d45f5c6897a9..0242979aea7d585abd276a011ffe45485b44d38c 100644 (file)
@@ -145,6 +145,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
         'column_name'
       );
     }
+    $columnName = $params['column_name'];
 
     $indexExist = FALSE;
     //as during create if field is_searchable we had created index.
@@ -284,9 +285,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
       self::createField($customField, 'modify', $indexExist);
     }
     else {
-      if (!isset($params['column_name'])) {
-        $columnName .= "_{$customField->id}";
-      }
       $customField->column_name = $columnName;
       $customField->save();
       // make sure all values are present in the object