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

feat(Totara): Adds \totara_program\event\program_assigned event. #583

Merged
merged 9 commits into from
Jun 18, 2019

Conversation

BrendanHalley
Copy link
Contributor

@BrendanHalley BrendanHalley commented Jun 12, 2019

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

@BrendanHalley BrendanHalley changed the title Support events that may not be supported by the install environment Support events that may not be supported by the install environment & first Totara event Jun 13, 2019
@BrendanHalley BrendanHalley marked this pull request as ready for review June 13, 2019 05:52
@@ -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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

@ryasmi ryasmi changed the title Support events that may not be supported by the install environment & first Totara event feat(Totara): Adds \totara_program\event\program_assigned event. Jun 18, 2019
@ryasmi ryasmi merged commit b5e699f into xAPI-vle:master Jun 18, 2019
@HT2Bot
Copy link
Member

HT2Bot commented Jun 18, 2019

🎉 This PR is included in version 4.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants