Skip to content
Snippets Groups Projects
Commit 79f68e44 authored by totten's avatar totten
Browse files

CRM-13089 - Restore numeric suffix for new (default) column names

----------------------------------------
* CRM-13089: CRM_Core_BAO_CustomField::create overrides user-defined name parameter values
  http://issues.civicrm.org/jira/browse/CRM-13089
parent 4d32d50b
Branches
Tags
No related merge requests found
......@@ -130,6 +130,8 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
* @static
*/
static function create(&$params) {
$origParams = array_merge(array(), $params);
if (!isset($params['id'])) {
if (!isset($params['column_name'])) {
// if add mode & column_name not present, calculate it.
......@@ -285,6 +287,10 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
self::createField($customField, 'modify', $indexExist);
}
else {
if (!isset($origParams['column_name'])) {
$columnName .= "_{$customField->id}";
$params['column_name'] = $columnName;
}
$customField->column_name = $columnName;
$customField->save();
// make sure all values are present in the object
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment