Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.1
-
Fix Version/s: 3.4.2
-
Component/s: Core CiviCRM
-
Labels:None
Description
CustomField also fails to honour the name parameter when passed.
Line 107 - 118 of Core/BAO/CustomField.php is:
if ( !isset($params['id']) && !isset($params['column_name']) )
else if ( isset($params['id']) )
{ $params['column_name'] = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_CustomField', $params['id'], 'column_name' ); }
Can I propose that this is amended to:
if ( !isset($params['id']) && !isset($params['column_name']) ) {
// if add mode & column_name not present, calculate it.
require_once 'CRM/Utils/String.php';
if(!isset($params['name']))
{ $params['name'] = $params['label']; }
$params['column_name'] =
strtolower( CRM_Utils_String::munge( $params['name'], '_', 32 ) );
$params['name'] = CRM_Utils_String::munge($params['name'], '_', 64 );
} else if ( isset($params['id']) )