aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2026-03-17 16:24:49 +0100
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2026-03-17 16:25:07 +0100
commit15d5590657faf962b8a2b7895af94a4243859e67 (patch)
tree36570ad299dd73990820d9250d240c1a66f2ca86
parentd315cd5816ab54dfea0424006e99bf6430aea3a6 (diff)
fix shuffling of group_ids, re #6363
-rw-r--r--app/controllers/my_studygroups.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/my_studygroups.php b/app/controllers/my_studygroups.php
index 5241706..bc7c0bd 100644
--- a/app/controllers/my_studygroups.php
+++ b/app/controllers/my_studygroups.php
@@ -154,9 +154,7 @@ class MyStudygroupsController extends AuthenticatedController
ORDER BY `seminare`.`mkdate` DESC
LIMIT 12
) AS `new_groups`
- ) AS `all_groups`
-
- LIMIT :amount";
+ ) AS `all_groups`";
$group_ids = DBManager::get()->fetchFirst($query, [
':studygroup_types' => $studygroup_sem_types,
':me' => $user_id,
@@ -165,6 +163,7 @@ class MyStudygroupsController extends AuthenticatedController
// Zufällig sortieren ist in PHP schneller als in SQL
shuffle($group_ids);
+ $group_ids = array_slice($group_ids, 0, $amount);
$cache->write($cache_id, $group_ids, 15 * 60);
return Course::findMany($group_ids);