Skip to content
Snippets Groups Projects
Commit 2db1e291 authored by David Siegfried's avatar David Siegfried
Browse files

prevent errors in LVGroupsWizardStep, fixes #5123

Closes #5123

Merge request studip/studip!3826
parent 60f2b288
No related branches found
No related tags found
No related merge requests found
...@@ -119,8 +119,6 @@ class LVGroupsWizardStep implements CourseWizardStep ...@@ -119,8 +119,6 @@ class LVGroupsWizardStep implements CourseWizardStep
public function getLVGroupTreeLevel($parentId, $parentClass) public function getLVGroupTreeLevel($parentId, $parentClass)
{ {
$level = []; $level = [];
$children = [];
$searchtree = [];
$course = Course::findCurrent(); $course = Course::findCurrent();
if ($course) { if ($course) {
...@@ -474,8 +472,7 @@ class LVGroupsWizardStep implements CourseWizardStep ...@@ -474,8 +472,7 @@ class LVGroupsWizardStep implements CourseWizardStep
$coursetype = 1; $coursetype = 1;
foreach ($values as $class) foreach ($values as $class)
{ {
if ($class['coursetype']) if (!empty($class['coursetype'])) {
{
$coursetype = $class['coursetype']; $coursetype = $class['coursetype'];
break; break;
} }
...@@ -487,8 +484,6 @@ class LVGroupsWizardStep implements CourseWizardStep ...@@ -487,8 +484,6 @@ class LVGroupsWizardStep implements CourseWizardStep
public function is_locked($values) public function is_locked($values)
{ {
global $perm;
// Has user access to this function? Access state is configured in global config. // Has user access to this function? Access state is configured in global config.
$access_right = Config::get()->MVV_ACCESS_ASSIGN_LVGRUPPEN; $access_right = Config::get()->MVV_ACCESS_ASSIGN_LVGRUPPEN;
...@@ -506,7 +501,7 @@ class LVGroupsWizardStep implements CourseWizardStep ...@@ -506,7 +501,7 @@ class LVGroupsWizardStep implements CourseWizardStep
$st->execute([$GLOBALS['user']->id, $inst_id]); $st->execute([$GLOBALS['user']->id, $inst_id]);
return !$st->fetchColumn(); return !$st->fetchColumn();
} }
return !$perm->have_studip_perm($access_right, $inst_id); return $inst_id && !$GLOBALS['perm']->have_studip_perm($access_right, $inst_id);
} }
......
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