-
Notifications
You must be signed in to change notification settings - Fork 86
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
feat(Totara): Adds \totara_program\event\program_assigned
event.
#583
Conversation
@@ -17,7 +17,7 @@ | |||
namespace src\transformer\utils\extensions; | |||
defined('MOODLE_INTERNAL') || die(); | |||
|
|||
function base(array $config, \stdClass $event, $course) { | |||
function base(array $config, \stdClass $event, $course=null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the reason for this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used base
in src/transformer/events/totara_program/program_assigned.php
in a context where a course doesn't exist. The course parameter is only required in this function for the jisc data.
In src/transformer/utils/extensions/course_area.php
the function course_area
(called from jisc util) already has a condition for if the course is null. I expect my change was actually how it was intended to be initially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense thanks for explaining
\totara_program\event\program_assigned
event.
🎉 This PR is included in version 4.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
It is necessary for us to have a mechanism that allows an event to be supported by the plugin but is not supported by the environment it's installed on.
Moodle has a core function that lists all events, our mapping function should only return events that the environment has installed and the plugin supports.
\totara_program\event\program_assigned
has also been added as an example of how Totara events will be implemented.Related Issues
#571
PR Type
Enhancement