Skip to content
Permalink
Browse files

Fix set of $userCourseCategoryId

  • Loading branch information...
jmontoyaa committed Feb 6, 2017
1 parent 47732ad commit 14a36f0ec763c99ba60e129da2044d334dfaf367
Showing with 8 additions and 3 deletions.
  1. +8 −3 main/inc/lib/course.lib.php
@@ -532,7 +532,7 @@ public static function subscribe_user(
$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 @@ public static function subscribe_user(
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 @@ public static function add_user_to_course(
'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);

0 comments on commit 14a36f0

Please sign in to comment.
You can’t perform that action at this time.