names shouldn't be squished together in activity details field
authordemeritcowboy <demeritcowboy@hotmail.com>
Thu, 17 Sep 2020 19:09:42 +0000 (15:09 -0400)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Thu, 17 Sep 2020 19:09:42 +0000 (15:09 -0400)
CRM/Contact/Form/Task/EmailTrait.php
templates/CRM/Activity/Form/ActivityView.tpl
tests/phpunit/CRM/Contact/Form/Task/EmailCommonTest.php

index fb5e6ff51289720245aaca6104a66901b6528473..c426d8d4bb193c627df0d9611fb64b672aec6e5b 100644 (file)
@@ -558,12 +558,12 @@ trait CRM_Contact_Form_Task_EmailTrait {
    *   e.g. <a href='{$contactURL}'>Bob Smith</a>'
    */
   protected function getEmailUrlString(array $emailIDs): string {
-    $urlString = '';
+    $urls = [];
     foreach ($emailIDs as $email) {
-      $contactURL = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'force' => 1, 'cid' => $this->contactEmails[$email]['contact_id']], TRUE);
-      $urlString .= "<a href='{$contactURL}'>" . $this->contactEmails[$email]['contact.display_name'] . '</a>';
+      $contactURL = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'cid' => $this->contactEmails[$email]['contact_id']], TRUE);
+      $urls[] = "<a href='{$contactURL}'>" . $this->contactEmails[$email]['contact.display_name'] . '</a>';
     }
-    return $urlString;
+    return implode(', ', $urls);
   }
 
   /**
index 4f68416e217b1e56855e9064e66c7874264884f4..b0a02df612d4372aee2c5e4bcbdd0ef27eab0bf8 100644 (file)
             </tr>
         {else}
              <tr>
-                 <td class="label">{ts}Details{/ts}</td><td class="view-value report">{$values.details|crmStripAlternatives|nl2br}</td>
+                 <td class="label">{ts}Details{/ts}</td><td class="view-value report">{$values.details|crmStripAlternatives|purify|nl2br}</td>
              </tr>
         {/if}
 {if $values.attachment}
index b136761010897d53159e1f4a797dd1f04c1db0d1..f717c39cb961c63b1e720c02df8934ae65a50105 100644 (file)
@@ -120,9 +120,9 @@ class CRM_Contact_Form_Task_EmailCommonTest extends CiviUnitTestCase {
     ]);
     $mut->stop();
     $activity = Activity::get(FALSE)->setSelect(['details'])->execute()->first();
-    $bccUrl1 = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'force' => 1, 'cid' => $bcc1], TRUE);
-    $bccUrl2 = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'force' => 1, 'cid' => $bcc2], TRUE);
-    $this->assertContains("bcc : <a href='" . $bccUrl1 . "'>Mr. Anthony Anderson II</a><a href='" . $bccUrl2 . "'>Mr. Anthony Anderson II</a>", $activity['details']);
+    $bccUrl1 = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'cid' => $bcc1], TRUE);
+    $bccUrl2 = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'cid' => $bcc2], TRUE);
+    $this->assertContains("bcc : <a href='" . $bccUrl1 . "'>Mr. Anthony Anderson II</a><a href='" . $bccUrl2 . "'>Mr. Anthony Anderson II</a>", $activity['details']);
     $this->assertEquals([
       [
         'text' => '27 messages were sent successfully. ',