Skip to content

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

Open
rhell4 wants to merge 1 commit intovfremaux:MOODLE_35_STABLEfrom
rhell4:MOODLE_35_DATE_FIX
Open

Fixing correct date being returned when global course is set to ID 1#17
rhell4 wants to merge 1 commit intovfremaux:MOODLE_35_STABLEfrom
rhell4:MOODLE_35_DATE_FIX

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