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

fix counting of matches in widget, fixes #2

parent d4779f4b
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
$pair_requests[$profile->id] = TandemPair::countByProfileAndStatus($profile, 0);
if (!$pairs[$profile->id]) {
//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) {
$matches_exist = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment