Fix set of $userCourseCategoryId

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 47732adcfa
commit 14a36f0ec7
  1. 11
      main/inc/lib/course.lib.php

@ -532,7 +532,7 @@ class CourseManager
$courseInfo = api_get_course_info($course_code);
$courseId = $courseInfo['real_id'];
$courseCode = $courseInfo['code'];
//$userCourseCategoryId = intval($userCourseCategoryId);
$userCourseCategoryId = intval($userCourseCategoryId);
if (empty($user_id) || empty($course_code)) {
return false;
@ -570,7 +570,12 @@ class CourseManager
if (!empty($session_id)) {
SessionManager::subscribe_users_to_session_course(array($user_id), $session_id, $courseCode);
} else {
CourseManager::add_user_to_course($user_id, $courseCode, $status);
CourseManager::add_user_to_course(
$user_id,
$courseCode,
$status,
$userCourseCategoryId
);
// Add event to the system log
Event::addEvent(
@ -728,7 +733,7 @@ class CourseManager
'status' => $status,
'sort' => $max_sort + 1,
'relation_type' => 0,
'user_course_cat' => $userCourseCategoryId
'user_course_cat' => (int) $userCourseCategoryId
];
$insertId = Database::insert($course_user_table, $params);

Loading…
Cancel
Save