Skip to content
Snippets Groups Projects
Commit 1f8cdfbd authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

prevent php8-warnings, closes #2615

Closes #2615

Merge request studip/studip!1764
parent 91dc71b8
No related branches found
No related tags found
No related merge requests found
...@@ -114,10 +114,10 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF ...@@ -114,10 +114,10 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
public static function filter($data, $search) public static function filter($data, $search)
{ {
$user = $GLOBALS['user'];
$structural_element = StructuralElement::find($data['id']); $structural_element = StructuralElement::find($data['id']);
$unit = $structural_element->findUnit(); $unit = $structural_element->findUnit();
if ($structural_element->canRead($user)) { if ($unit && $structural_element->canRead($GLOBALS['user'])) {
$description = '';
if ($data['type'] === 'cw_structural_elements') { if ($data['type'] === 'cw_structural_elements') {
$description = self::mark($structural_element->payload['description'], $search, true); $description = self::mark($structural_element->payload['description'], $search, true);
} }
......
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