From 5ab5b41758b4afd05131a7d02e11bab5ff57ade6 Mon Sep 17 00:00:00 2001 From: "B. Endres" Date: Fri, 15 Nov 2019 08:18:33 +0100 Subject: [PATCH] fixed profile selection --- CRM/Twingle/Profile.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/Twingle/Profile.php b/CRM/Twingle/Profile.php index bd1e7c3..37e9365 100644 --- a/CRM/Twingle/Profile.php +++ b/CRM/Twingle/Profile.php @@ -287,16 +287,14 @@ class CRM_Twingle_Profile { public static function getProfileForProject($project_id) { $profiles = self::getProfiles(); - // If none matches, use the default profile. - $profile = $profiles['default']; - foreach ($profiles as $profile) { if ($profile->matches($project_id)) { - break; + return $profile; } } - return $profile; + // If none matches, use the default profile. + return $profiles['default']; } /**