avoid variable name clash
authorDemeritCowboy <demeritcowboy@hotmail.com>
Sat, 7 Sep 2019 12:28:43 +0000 (08:28 -0400)
committerDemeritCowboy <demeritcowboy@hotmail.com>
Sat, 7 Sep 2019 12:31:46 +0000 (08:31 -0400)
CRM/Activity/Form/Activity.php
templates/CRM/Activity/Form/Activity.tpl
tests/phpunit/CRM/Activity/Form/ActivityTest.php

index 314dd454fc3f5d797749b34da3d8d72206834ab1..e572fecd8639094a3f74b29e33895d0e00d4a425 100644 (file)
@@ -1244,7 +1244,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
 
         // At the moment this is duplicating other code in this section, but refactoring in small steps.
         $activityTypeObj = new CRM_Activity_BAO_ActivityType($this->_activityTypeId);
-        $this->assign('activityType', $activityTypeObj->getActivityType());
+        $this->assign('activityTypeNameAndLabel', $activityTypeObj->getActivityType());
       }
       // Set title.
       if (isset($activityTypeDisplayLabels)) {
index a9a2dea5365ee6bceec8d025e5d9b4db56b9828a..ac19690e42e3eb4a5d08570f06d7a4ef5cad9299 100644 (file)
   {/if} {* End Delete vs. Add / Edit action *}
   </table>
   <div class="crm-submit-buttons">
-  {if $action eq 4 && ($activityType.machineName neq 'Inbound Email' || $allow_edit_inbound_emails == 1)}
+  {if $action eq 4 && ($activityTypeNameAndLabel.machineName neq 'Inbound Email' || $allow_edit_inbound_emails == 1)}
     {if !$context }
       {assign var="context" value='activity'}
     {/if}
index 7bd5e61faffc5b4d651166ddba8f88e6e927ebc2..6fceb9a701cb528d097a7517a06399984037ef45 100644 (file)
@@ -244,7 +244,7 @@ class CRM_Activity_Form_ActivityTest extends CiviUnitTestCase {
     $form->assignActivityType();
 
     // Check the smarty template has the correct values assigned.
-    $keyValuePair = $form->getTemplate()->get_template_vars('activityType');
+    $keyValuePair = $form->getTemplate()->get_template_vars('activityTypeNameAndLabel');
     $this->assertEquals('47395hc', $keyValuePair['machineName']);
     $this->assertEquals('Hide Cookies', $keyValuePair['displayLabel']);