CRM-21052 - Activity.create API - Abide by setting `civicaseActivityRevisions`
[civicrm-core.git] / api / v3 / MailingContact.php
index b0fd28e891c28b1f566352b42a1dab66660f2982..9d14e1030c401c9213277692e218fbd6df7551cb 100644 (file)
@@ -159,7 +159,7 @@ GROUP BY   m.id
     }
     $select = implode(', ', $select);
 
-    $orderBy = 'ORDER BY j.start_date DESC';
+    $orderBy = 'ORDER BY MIN(j.start_date) DESC';
     if ($sort) {
       $orderBy = "ORDER BY $sort";
     }