Simplify if statement
authorMatthew Wire <mjw@mjwconsult.co.uk>
Sat, 4 Jan 2020 12:24:05 +0000 (12:24 +0000)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Sat, 4 Jan 2020 12:24:05 +0000 (12:24 +0000)
CRM/Case/Form/Activity.php

index 1eaf0d49a9731c9b8dc7cf292853806d01a514c9..b6e2778423dd0af4f257c03b17b5505ed026e6b5 100644 (file)
@@ -502,6 +502,9 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity {
       }
     }
     else {
+      // create a new version of activity if activity was found to
+      // have been modified/created by user
+
       // since the params we need to set are very few, and we don't want rest of the
       // work done by bao create method , lets use dao object to make the changes
       $params = ['id' => $this->_activityId];
@@ -509,11 +512,7 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity {
       $activity = new CRM_Activity_DAO_Activity();
       $activity->copyValues($params);
       $activity->save();
-    }
 
-    // create a new version of activity if activity was found to
-    // have been modified/created by user
-    if (isset($newActParams)) {
       // set proper original_id
       if (!empty($this->_defaults['original_id'])) {
         $newActParams['original_id'] = $this->_defaults['original_id'];