Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion classes/steps/lookups/course_lookup_step.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ public function execute($step, $trigger, $event, $stepresults) {
foreach ($coursedata as $key => $value) {
$stepresults[$this->outputprefix . $key] = $value;
}

$handler = \core_customfield\handler::get_handler('core_course', 'course');
$datas = $handler->get_instance_data($courseid);
foreach ($datas as $data) {
if (empty($data->get_value())) {
continue;
}
$key = $data->get_field()->get('shortname');
$stepresults[$this->outputprefix . $key] = $data->get_value();
}

return [true, $stepresults];
}

Expand Down Expand Up @@ -175,7 +186,11 @@ public static function get_privacyfields() {
* @return array $stepfields The fields this step provides.
*/
public static function get_fields() {
return self::$stepfields;
$handler = \core_customfield\handler::get_handler('core_course', 'course');
$customfields = array_walk($handler->get_fields(), function(&$field) {
$field = $field->get('shortname');
});

return self::$stepfields + $customfields;
}
}