aboutsummaryrefslogtreecommitdiff
path: root/lib/models/BlubberThread.php
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2025-03-04 07:51:32 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2025-03-04 07:51:32 +0000
commit53b6639939c9e5de034284655bdc50782dbc80f0 (patch)
tree2e5b3b3e39bea61b43e090bb1fab6d4778bc27a5 /lib/models/BlubberThread.php
parentfbd1b2cf0036300792f6535ae9aa5a44a028f34c (diff)
Resolve "Timeout bei großen Blubber Threads"
Closes #5313 Merge request studip/studip!4001
Diffstat (limited to 'lib/models/BlubberThread.php')
-rw-r--r--lib/models/BlubberThread.php31
1 files changed, 2 insertions, 29 deletions
diff --git a/lib/models/BlubberThread.php b/lib/models/BlubberThread.php
index 4c3b585..17b3c95 100644
--- a/lib/models/BlubberThread.php
+++ b/lib/models/BlubberThread.php
@@ -464,41 +464,14 @@ class BlubberThread extends SimpleORMap implements PrivacyObject
public function getContextTemplate()
{
if ($this['context_type'] === 'course') {
- $course = Course::find($this['context_id']);
- $icons = [];
- $schedule_active = false;
- foreach ($course->tools as $tool) {
- if ($module = $tool->getStudipModule()) {
- $last_visit = object_get_visit($this['context_id'], $module->getPluginId());
- $nav = $module->getIconNavigation($this['context_id'], $last_visit, $GLOBALS['user']->id);
- if (
- isset($nav)
- && $nav->isVisible(true)
- && $module->getTabNavigation($this['context_id'])
- && $GLOBALS['perm']->have_studip_perm($tool->getVisibilityPermission(), $this['context_id'])
- ) {
- $icons[] = $nav;
- }
- if ($module instanceof CoreSchedule) {
- $schedule_active = true;
- }
- }
- }
-
- $nextdate = false;
- if ($schedule_active) {
- $nextdate = CourseDate::findOneBySQL("range_id = ? AND `date` >= UNIX_TIMESTAMP() ORDER BY `date` ASC", [$this['context_id']]);
- }
-
$teachers = CourseMember::findBySQL("Seminar_id = ? AND status = 'dozent' ORDER BY position ASC", [$this['context_id']]);
$tutors = CourseMember::findBySQL("Seminar_id = ? AND status = 'tutor' ORDER BY position ASC", [$this['context_id']]);
$students_count = CourseMember::countBySQL("Seminar_id = ? AND status IN ('autor', 'user') ORDER BY position ASC", [$this['context_id']]);
$template = $GLOBALS['template_factory']->open('blubber/course_context');
$template->thread = $this;
- $template->course = $course;
- $template->icons = $icons;
- $template->nextdate = $nextdate;
+ $template->course = Course::find($this['context_id']);
+
$template->teachers = $teachers;
$template->tutors = $tutors;
$template->students_count = $students_count;