Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8119

CustomField also fails to honour the name parameter when passed.

    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']) )

      { // if add mode & column_name not present, calculate it. require_once 'CRM/Utils/String.php'; $params['column_name'] = strtolower( CRM_Utils_String::munge( $params['label'], '_', 32 ) ); $params['name'] = CRM_Utils_String::munge($params['label'], '_', 64 ); }

      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']) )

      { $params['column_name'] = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_CustomField', $params['id'], 'column_name' ); }

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              tomgillett Tom Gillett
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: