CRM-8746 Fix confirmation email with custom data

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.4.5
    • Fix Version/s: 3.4.6
    • Component/s: CiviEvent
    • Labels:
      None

      Description

      Fix the erroneous behavior described below :
      http://forum.civicrm.org/index.php?topic=21240.0

        Attachments

          Activity

          [CRM-8746] Fix confirmation email with custom data
          Helen Bergin added a comment -

          Around Ln 1250, at the end of the buildCustomDisplay function in CRM/Event/BAO/Event.php, if I make the following changes, I get the profiles showing up correctly in the confirmation email.

          Basically, comment out the $val assignment, and change the $val references to $values. Not sure if this is the right fix, but wanted to post info here to see if it helps resolve the issue.

          //$val[] = $values;
          }
          }
          if (count( $values ) )

          { $template->assign( $name, $values ); }

          if ( count ($groupTitles))

          { $template->assign( $name.'_grouptitle', $groupTitles ); }

          //return if we only require array of participant's info.
          if ( $isCustomProfile ) {
          if ( count($values) )

          { return array( $values, $groupTitles ); }

          else {
          return null;

          Helen Bergin added a comment -

          To get the group titles to show up in the Event Confirmation email, I edited the following around Ln 1186 in the BuildCustomDisplay function of the CRM/Event/BAO/Event.php file, adding the $name."_grouptitle" to the array key.

          if ( $groupTitle )

          { //ORIGINAL CODE $groupTitles[] = $groupTitle; $groupTitles[$name."_grouptitle"] = $groupTitle; }
          Helen Bergin added a comment -

          Sorry, spoke too soon, please disregard previous comment.

          Helen Bergin added a comment -

          I was missing a couple of things. The following changes do seem to make the group headers appear correctly in the email confirmation. The code changes are based on how code used to be in the 3.3 file version :

          Around Ln 1186 in the BuildCustomDisplay function of the CRM/Event/BAO/Event.php file:

          if ( $groupTitle )

          { //ORIGINAL CODE: $groupTitles[] = $groupTitle; $template->assign( $name."_grouptitle", $groupTitle ); $groupTitles[ $name."_grouptitle" ] = $groupTitle; }

          Around Ln 1256 in the BuildCustomDisplay function of the CRM/Event/BAO/Event.php file:

          //COMMENT OUT THE FOLLOWING ASSIGNMENT
          /*
          if ( count ($groupTitles))

          { $template->assign( $name.'_grouptitle', $groupTitles ); }

          */

          Hershel Robinson added a comment -

          Your first fix worked for one of my clients. Thank you.

          Ashwini Poharkar added a comment -

          I'm having a problem trying to replicate this issue on my local install.
          There might be a possibility that your message templates might not be upgraded.
          Could you please check the "Events - Registration Confirmation and Receipt (on-line)" message template
          in the latest version or in the 3.4.5 tarball available on http://sourceforge.net/projects/civicrm/files/.

          Just copy the message template available in the latest version or in the fresh 3.4.5 tarball downloaded from
          http://sourceforge.net/projects/civicrm/files/
          and paste the code into the UI available here "Administer >> Configure >> Message Templates" - System Workflow messages and save.
          ( Make sure that you have the database backup before modifying the message templates )

          Deepak Srivastava added a comment -

          Hershel,

          We are unable to reproduce the problem. And we suspect its the issue with message templates, which might be wrong. Try replacing message template with that of v3.4.5 (fresh install) as suggested by Ashwini & see if that helps.

          If this works out, probably you have the corrupt tarball, since we remember a corrupt tarball (v3.4.5) being out for sometime with same issue (for very short time ~ 15mins or so).

          Closing the issue for now.

          Feel free to re-open if we more details or steps to reproduce.

          thanks,

          Helen Bergin added a comment -

          Thanks very much, Deepak. It does seem that when the system was upgraded to 3.4.5 that the message template did not upgrade to the version currently on sourceforge.

          I replaced the message template code, as instructed, and the problem is no longer there.

          Helen

            People

            • Assignee:
              Ashwini Poharkar
              Reporter:
              Yashodha Chaku

              Dates

              • Created:
                Updated:
                Resolved: