Skip to content

Commit

Permalink
HotFix: Observer error
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderJacob committed Dec 14, 2023
1 parent aa1b8a7 commit ed96d62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions classes/external/observer_course_completed.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ public static function observe($event) {
global $DB;
$params = $event;
$userpathrelation = new user_path_relation();
$learningpaths = $userpathrelation->get_learning_paths($params['courseid']);
$learningpaths = $userpathrelation->get_learning_paths($params->courseid);
if ($learningpaths) {
foreach ($learningpaths as $learningpath) {
$learningpath->json = json_decode($learningpath->json, true);
$userpath = $userpathrelation->get_user_path_relation($learningpath, $params->relateduserid);
if (!$userpath) {
$userpath->json = json_decode($userpath->json, true);
foreach ($learningpath->json['tree']->nodes as $node) {
if ($node['course_node_id'] == $params['courseid']) {
$learningpath->json['user_path_relaction'][$params['courseid']] = true;
if ($node['course_node_id'] == $params->courseid) {
$learningpath->json['user_path_relaction'][$params->courseid] = true;
// Revision old user path relation.
$data = [
'id' => $userpath->id,
Expand Down

0 comments on commit ed96d62

Please sign in to comment.