From ce0e9bdc43b1006d5259a8bad77dd5883e2561ed Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 12 Jul 2020 22:58:48 +1200 Subject: [PATCH] Sort permittedActivityTypes When determining whether to add a clause filtering activity types the permitted types are compared to all types. If all are permitted no clause is needed. However, without this sort it is incorrectly seeing them as not matching and adding extraneous joins --- CRM/Activity/BAO/Activity.php | 1 + 1 file changed, 1 insertion(+) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index cea9b53355..a4065942ca 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -2455,6 +2455,7 @@ INNER JOIN civicrm_option_group grp ON (grp.id = option_group_id AND grp.name = foreach ($types as $type) { $permittedActivityTypes[$type['activity_type_id']] = (int) $type['activity_type_id']; } + asort($permittedActivityTypes); Civi::$statics[__CLASS__]['permitted_activity_types'][$userID] = $permittedActivityTypes; } return Civi::$statics[__CLASS__]['permitted_activity_types'][$userID]; -- 2.25.1