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

The 'StripAlternatives' code for viewing activties/sent email incorrectly identifies blank HTML

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.2, 3.2.1, 3.2.2, 3.2.3
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      See forum discussion here:
      http://forum.civicrm.org/index.php/topic,16153.0.html

      Basically when viewing a 'sent email' activity that has message details field containing an alternate HTML and plain text versions, and the HTML version consists only of blank paragraphs or line breaks, the HTML version is chosen but appears to display nothing, even when the plain text version may have full text in it. This appears to be quite common, as the CKeditor has a habit of inserting paragraph and line break tags (<p> and <br/>) even when no text is entered into it.
      This is then confusing to users, because they go back to look at historical emails and see only a blank screen (just the paragraph and line break tags in the HTML).

      A suggested patch for CRM\utils\String.php is attached which strips the tags from the HTML field before checking if it is blank.
      This works but might want to be extended to only strip <p> and <br/> tags in the case where someone intentionally used blank tags (such as <img> for example)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: