Skip to content

Commit

Permalink
Fixed issue on user skills list for the new user
Browse files Browse the repository at this point in the history
  • Loading branch information
prasanna-lmsace committed Nov 8, 2023
1 parent a7d9ac0 commit 30ece05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions classes/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ public function get_user_skills() {
// Fetch the list of user enrolled courses.
$courses = enrol_get_users_courses($this->userid, true, 'id');
$ids = array_column($courses, 'id');

// User not assigned to any course then not skills to earn.
if (empty($ids)) {
return [];
}

// Prepare IN condition query to get skills from the user enroled courses.
list($insql, $inparams) = $DB->get_in_or_equal($ids, SQL_PARAMS_NAMED, 'cid');

Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

defined('MOODLE_INTERNAL') || die('No direct access');

$plugin->version = 2023102502;
$plugin->version = 2023102503;
$plugin->requires = 2021051700; // Requires this Moodle version.
$plugin->component = 'tool_skills'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE;
Expand Down

0 comments on commit 30ece05

Please sign in to comment.