Skip to content
Snippets Groups Projects
Commit 67ae01c1 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

fixes #3541

Closes #3541

Merge request studip/studip!2430
parent 4795c42f
No related branches found
No related tags found
No related merge requests found
...@@ -1165,7 +1165,7 @@ class SemBrowse { ...@@ -1165,7 +1165,7 @@ class SemBrowse {
if (is_null($option_name)) { if (is_null($option_name)) {
$options = Config::get()->COURSE_SEARCH_NAVIGATION_OPTIONS; $options = Config::get()->COURSE_SEARCH_NAVIGATION_OPTIONS;
foreach ($options as $name => $option) { foreach ($options as $name => $option) {
if ($option['visible'] && $option['target'] == $target) { if ($option['visible'] && $option['target'] === $target) {
return self::getSearchOptionNavigation($target, $name); return self::getSearchOptionNavigation($target, $name);
} }
} }
...@@ -1175,7 +1175,7 @@ class SemBrowse { ...@@ -1175,7 +1175,7 @@ class SemBrowse {
$installed_languages = array_keys(Config::get()->INSTALLED_LANGUAGES); $installed_languages = array_keys(Config::get()->INSTALLED_LANGUAGES);
$language = $_SESSION['_language'] ?: reset($installed_languages); $language = $_SESSION['_language'] ?: reset($installed_languages);
$option = Config::get()->COURSE_SEARCH_NAVIGATION_OPTIONS[$option_name]; $option = Config::get()->COURSE_SEARCH_NAVIGATION_OPTIONS[$option_name];
if (!$option['visible'] || $option['target'] != $target) { if (!$option['visible'] || $option['target'] !== $target) {
return null; return null;
} }
if (empty($option['url'])) { if (empty($option['url'])) {
...@@ -1201,7 +1201,7 @@ class SemBrowse { ...@@ -1201,7 +1201,7 @@ class SemBrowse {
return new Navigation($option['title'][$language], return new Navigation($option['title'][$language],
URLHelper::getURL($option['url'], ['option' => $option_name], true)); URLHelper::getURL($option['url'], ['option' => $option_name], true));
} }
if ($option['sem_tree_id']) { if (!empty($option['sem_tree_id'])) {
$study_area = StudipStudyArea::find($option['sem_tree_id']); $study_area = StudipStudyArea::find($option['sem_tree_id']);
return new Navigation($study_area->name, return new Navigation($study_area->name,
URLHelper::getURL('dispatch.php/search/courses', URLHelper::getURL('dispatch.php/search/courses',
...@@ -1214,7 +1214,7 @@ class SemBrowse { ...@@ -1214,7 +1214,7 @@ class SemBrowse {
'option' => $option_name 'option' => $option_name
], true)); ], true));
} }
if ($option['range_tree_id']) { if (!empty($option['range_tree_id'])) {
$item_name = DBManager::get()->fetchColumn(' $item_name = DBManager::get()->fetchColumn('
SELECT `name` SELECT `name`
FROM `range_tree` FROM `range_tree`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment