be less loopy
authorDemeritCowboy <demeritcowboy@hotmail.com>
Wed, 9 Oct 2019 22:31:30 +0000 (18:31 -0400)
committerDemeritCowboy <demeritcowboy@hotmail.com>
Wed, 9 Oct 2019 22:31:30 +0000 (18:31 -0400)
CRM/Utils/DeprecatedUtils.php

index 0045346efebca8c2eac7207acb917adf95ed1dc1..ed07a6b2aa61e717ac5062ac9045f5db1e34366f 100644 (file)
@@ -884,6 +884,10 @@ function _civicrm_api3_deprecated_activity_buildmailparams($result, $activityTyp
     if (isset($result["attachFile_$i"])) {
       $params["attachFile_$i"] = $result["attachFile_$i"];
     }
+    else {
+      // No point looping 100 times if there's only one attachment
+      break;
+    }
   }
 
   return $params;