Internal: Fix php fatal error

pull/3513/head
Julio Montoya 4 years ago
parent cef422ccd5
commit 939126c2a1
  1. 2
      public/main/inc/lib/course.lib.php
  2. 4
      public/main/inc/lib/groupmanager.lib.php
  3. 4
      src/CoreBundle/EventListener/CourseListener.php

@ -2571,7 +2571,7 @@ class CourseManager
$groupCategories = GroupManager::get_categories($course['code']);
if (!empty($groupCategories)) {
foreach ($groupCategories as $category) {
GroupManager::delete_category($category['id'], $course['code']);
GroupManager::delete_category($category['iid'], $course['code']);
}
}

@ -906,7 +906,7 @@ class GroupManager
$table_group = Database::get_course_table(TABLE_GROUP);
$table_group_cat = Database::get_course_table(TABLE_GROUP_CATEGORY);
$cat_id = intval($cat_id);
$cat_id = (int) $cat_id;
$sql = "SELECT iid FROM $table_group
WHERE c_id = $course_id AND category_id='".$cat_id."'";
$res = Database::query($sql);
@ -922,7 +922,7 @@ class GroupManager
}
}
$sql = "DELETE FROM $table_group_cat
WHERE c_id = $course_id AND id='".$cat_id."'";
WHERE c_id = $course_id AND iid='".$cat_id."'";
Database::query($sql);
return true;

@ -84,6 +84,10 @@ class CourseListener
$em = $container->get('doctrine')->getManager();
$course = $em->getRepository(Course::class)->find($courseId);
if (null === $course) {
throw new NotFoundHttpException($translator->trans('Course does not exist'));
}
//dump("Course loaded from DB $courseId");
$courseInfo = api_get_course_info($course->getCode());
}

Loading…
Cancel
Save