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

Profile fields display as 'Array' in online contribution email receipts

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.5, 3.4.6, 3.4.7, 4.0.5, 4.0.6, 4.0.7
    • Fix Version/s: 3.4.8
    • Component/s: CiviContribute
    • Labels:
      None

      Description

      The changes made to support unlimited profiles for event registration forms in 3.4.5/4.0.5 broke email receipts for online contributions when the contribution form contains a bottom-of-page profile. The top-of-page profile displays fine in the receipt, but the bottom-of-page profile shows raw field names (eg, first_name, phone-3-1, cutom_5, etc) and the word 'Array' for the corresponding values.

      The problem is in the return value from CRM_Core_BAO_UFJoin::getUFGroupIds(). The array returned contains an int for the first Group ID and an array for the second Group ID. I changed the second Group ID from an array to an int, and the problem is solved for contribution receipts. I have not verified if there are any consequences to the change to support unlimited profiles in event registration forms.

      Here is the original source:

      while ( $dao->fetch( ) ) {
      if ($dao->weight == 1)

      { $first = $dao->uf_group_id; $firstActive = $dao->is_active; }

      else

      { $second[] = $dao->uf_group_id; $secondActive[] = $dao->is_active; }

      }
      return array( $first, $second, $firstActive, $secondActive );

      The change I made was to remove the array brackets from $second[] and $secondActive[].

        Attachments

          Activity

            People

            • Assignee:
              rohan Rohan S. Chavan
              Reporter:
              marty Marty Wright
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: