Skip to content
Snippets Groups Projects
Unverified Commit dc5c3fa5 authored by Tobias Reischmann's avatar Tobias Reischmann
Browse files

Set system context for format_text in email step

parent c6c03fda
No related branches found
No related tags found
No related merge requests found
......@@ -89,10 +89,12 @@ class email extends libbase {
}
public function post_processing_bulk_operation() {
global $DB;
global $DB, $PAGE;
$stepinstances = step_manager::get_step_instances_by_subpluginname($this->get_subpluginname());
foreach ($stepinstances as $step) {
$settings = settings_manager::get_settings($step->id, SETTINGS_TYPE_STEP);
// Set system context, since format_text needs a context.
$PAGE->set_context(\context_system::instance());
// Format the raw string in the DB to FORMAT_HTML.
$settings['contenthtml'] = format_text($settings['contenthtml'], FORMAT_HTML);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment