Skip to content
Snippets Groups Projects
Commit 7e0a09c8 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

fix counting of matches in widget, fixes #2

parent 5d1bb235
No related branches found
No related tags found
No related merge requests found
...@@ -275,7 +275,13 @@ class TandemPlugin extends StudIPPlugin implements SystemPlugin, PortalPlugin, H ...@@ -275,7 +275,13 @@ class TandemPlugin extends StudIPPlugin implements SystemPlugin, PortalPlugin, H
$pair_requests[$profile->id] = TandemPair::countByProfileAndStatus($profile, 0); $pair_requests[$profile->id] = TandemPair::countByProfileAndStatus($profile, 0);
if(!$pairs[$profile->id]) { if(!$pairs[$profile->id]) {
//We're only looking for matches if no pairs have been found. //We're only looking for matches if no pairs have been found.
$match_count[$profile->id] = TandemMatching::countMatches($profile); $matches = TandemMatching::findMatches($profile);
if (Config::get()->TANDEMPLUGIN_USE_LEVEL) {
$matches = array_filter($matches, function($match) use ($user_id) {
return $match->matchesSpokenLanguages($user_id);
});
}
$match_count[$profile->id] = count($matches);
if($match_count[$profile->id] > 0) { if($match_count[$profile->id] > 0) {
$matches_exist = true; $matches_exist = true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment