Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAICI unusable on specific moodle site because course id is always 1 #9

Open
pidaback opened this issue May 31, 2024 · 0 comments
Open

Comments

@pidaback
Copy link

This is not really a bug report, as I doubt the MAICI plug-in is at fault. However, I wanted to point you to this thread in the moodle developer forum. Below is a summary of my problem:

MAICI creates a new instance of completion_info in classes/completion.php. At this point, there is no problem with the course ID:

$course = get_course($moduleinstance->course);
// As expected, $course->id is a valid id >= 2
$completion = new \completion_info($course);

In the moodle core, lib/navigationlib.php is later called. This line (line 1469 in moodle 4.2.1) causes my problem:

$issite = ($this->page->course->id == $SITE->id);

At this point, $this->page->course->id equals 1 - but only in our production system. This causes subsequent error and makes MAICI unusable. I could not reproduce this error with my local environment, or our testing system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant