Skip to content
Snippets Groups Projects
Commit f3f0709d authored by mmikitka's avatar mmikitka
Browse files

Fix for issue CRM-13089

----------------------------------------
* CRM-13089: CRM_Core_BAO_CustomField::create overrides user-defined name parameter values
  http://issues.civicrm.org/jira/browse/CRM-13089
parent 07e77fbc
No related branches found
No related tags found
No related merge requests found
......@@ -130,14 +130,17 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
* @static
*/
static function create(&$params) {
if (!isset($params['id']) && !isset($params['column_name'])) {
// if add mode & column_name not present, calculate it.
$columnName = strtolower(CRM_Utils_String::munge($params['label'], '_', 32));
$params['name'] = CRM_Utils_String::munge($params['label'], '_', 64);
if (!isset($params['id'])) {
if (!isset($params['column_name'])) {
// if add mode & column_name not present, calculate it.
$params['column_name'] = strtolower(CRM_Utils_String::munge($params['label'], '_', 32));
}
if (!isset($params['name'])) {
$params['name'] = CRM_Utils_String::munge($params['label'], '_', 64);
}
}
elseif (isset($params['id'])) {
$columnName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField',
else {
$params['column_name'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField',
$params['id'],
'column_name'
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment