Merge branch 'mdl-85036_main' of https://github.com/james-cnz/moodle

This commit is contained in:
Huong Nguyen
2025-11-06 10:34:53 +08:00
committed by Jake Dallimore
2 changed files with 3 additions and 3 deletions
@@ -53,7 +53,7 @@ class completion_info_exporter extends \core\external\exporter {
*/
public function __construct(object $course, object $cm, int $userid, array $related = []) {
$this->course = $course;
$this->cminfo = \cm_info::create($cm);
$this->cminfo = \cm_info::create($cm, $userid);
$this->userid = $userid;
parent::__construct([], $related);
}
+2 -2
View File
@@ -1412,8 +1412,8 @@ class cm_info implements IteratorAggregate {
if (!$cm) {
return null;
}
// If it is already a cm_info object, just return it.
if ($cm instanceof cm_info) {
// If it is already a cm_info object with the right user, just return it.
if (($cm instanceof cm_info) && ($cm->get_modinfo()->userid == $userid)) {
return $cm;
}
// Otherwise load modinfo.