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

CiviCRM Profile for a link type field has incorrect display when visibility is "Public User Pages"

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.9
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      When a profile field is created using a custom data field of type "Link" it's not displayed correctly in the Drupal
      My Account section.

      The fix for the bug is given below.

      [root@bfc22 modules]# diff civicrm/CRM/Core/BAO/UFGroup.php civicrm/CRM/Core/BAO/UFGroup.php.org
      846,848d845
      <
      < /****
      <
      859,860d855
      <
      < ****/
      [root@bfc22 modules]#

      essentially the code there does the following
      if ( $field['visibility'] == "User and User Admin Only"|| $field['visibility'] == "Public User Pages" ) {

      $customFieldID = CRM_Core_BAO_CustomField::getKeyID($field['name']);
      if ( CRM_Core_BAO_CustomField::getKeyID($field['name']) ) {
      $htmlType = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_CustomField', $customFieldID, 'html_type', 'id' );
      if($htmlType == 'Link')

      { $values[$index] = '<a href="' . $values[$index] . '">' . $values[$index] . '</a>'; }

      }
      }
      so it can be seen that for type = link it's adding another A href which it already gets from
      values[$index] = CRM_Core_BAO_CustomField::getDisplayValue( $customVal, $cfID, $options );

      Thanks.

      Prakash.

        Attachments

          Activity

            People

            • Assignee:
              manish Manish Zope
              Reporter:
              prakash Prakash Patel
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: