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

Warning when going to civimail report page

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.0.4
    • Fix Version/s: 3.4.5
    • Component/s: CiviMail
    • Labels:
      None

      Description

      Create a mailing without html header and (or) footer, send it (immediately), go to the report page, "View complete message" pop-ups your message, refresh the report page and you obtain :
      """
      Notice: Undefined variable: htmlHeader in CRM_Mailing_BAO_Mailing->getMailingContent() (line 2329 of /var/www/drupal/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
      Notice: Undefined variable: htmlFooter in CRM_Mailing_BAO_Mailing->getMailingContent() (line 2329 of /var/www/drupal/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
      """

      In /var/www/drupal/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php, the htmlHeader (and htmlFooter) var is initialized into a conditionnal if block but is used outside of it:

      /var/www/drupal/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php line 2305
      """
      if ($report['mailing']['header_id'])

      { ... $htmlHeader = $header->body_html; ... }

      ...
      echo $htmlHeader . $report['mailing']['body_html'] . $htmlFooter;
      """

      a quick solution could be to initialize those vars to void before using if blocks like in the attached diff file

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              tonthon tonthon
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 30 minutes
                30m
                Remaining:
                Remaining Estimate - 30 minutes
                30m
                Logged:
                Time Spent - Not Specified
                Not Specified