diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-11-02 08:06:14 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-11-02 08:06:14 +0000 |
| commit | f71ee9305d044b982ae4d65e5c29671dc8b40d9e (patch) | |
| tree | e5965ca4fe63b3567d67b672df87335235dd26be /app/controllers/my_institutes.php | |
| parent | 1c3cd7a0236c0aaa0062dc43bf1dadb21c8f8a4e (diff) | |
fix call to tabularasa action for institutes, fixes #1734
Closes #1734
Merge request studip/studip!1129
Diffstat (limited to 'app/controllers/my_institutes.php')
| -rw-r--r-- | app/controllers/my_institutes.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/controllers/my_institutes.php b/app/controllers/my_institutes.php index a17862f..484f558 100644 --- a/app/controllers/my_institutes.php +++ b/app/controllers/my_institutes.php @@ -61,9 +61,15 @@ class MyInstitutesController extends AuthenticatedController public function tabularasa_action($timestamp = null) { $institutes = MyRealmModel::getMyInstitutes(); - foreach ($institutes as $index => $institut) { - MyRealmModel::setObjectVisits($institutes[$index], $institut['institut_id'], $this->user_id, $timestamp); - } + + // This is ugly but since the above does not return object, we need to + // load the institutes again + Institute::findEachMany( + function (Institute $institute) use ($timestamp) { + MyRealmModel::setObjectVisits($institute, $this->user_id, $timestamp); + }, + array_column($institutes, 'institut_id') + ); PageLayout::postSuccess(_('Alles als gelesen markiert!')); $this->redirect('my_institutes/index'); |
