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

Fixing correct date being returned when global course is set to ID 1 #17

Open
wants to merge 1 commit into
base: MOODLE_35_STABLE
Choose a base branch
from

Conversation

rhell4
Copy link

@rhell4 rhell4 commented Oct 3, 2019

Sometimes is_available() is called when the global COURSE var has an id of 1, for example calendar events or accessing the activity with a direct link. This means the activity isn't completely restricted.

I've extracted the course from the \core_availability\info passed and used it to get the correct course id while also falling back to the global COURSE if no course is passed down to get_reference_date().

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

Successfully merging this pull request may close these issues.

1 participant