Skip to content
Snippets Groups Projects
Commit 8ab35a15 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Elmar Ludwig
Browse files

prevent warning, fixes #2436

Closes #2436

Merge request studip/studip!1631
parent 86cecc19
No related branches found
No related tags found
No related merge requests found
Pipeline #11195 passed
......@@ -48,11 +48,16 @@ class CourseNavigation extends Navigation
{
parent::initSubNavigation();
foreach (Context::get()->tools as $tool) {
if (Context::isInstitute() || Seminar_Perm::get()->have_studip_perm($tool->getVisibilityPermission(), Context::get()->getId())) {
$context = Context::get();
if (!$context) {
return;
}
foreach ($context->tools as $tool) {
if (Context::isInstitute() || Seminar_Perm::get()->have_studip_perm($tool->getVisibilityPermission(), $context->id)) {
$studip_module = $tool->getStudipModule();
if ($studip_module instanceof StudipModule) {
$tool_nav = $studip_module->getTabNavigation(Context::getId()) ?: [];
$tool_nav = $studip_module->getTabNavigation($context->id) ?: [];
foreach ($tool_nav as $nav_name => $navigation) {
if ($nav_name && is_a($navigation, "Navigation")) {
if ($tool->metadata['displayname']) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment