Skip to content
Snippets Groups Projects
Unverified Commit b9c7d86d authored by Thomas Marstrander's avatar Thomas Marstrander
Browse files

Fix core not being able to write to session when making tokens

This would cause a mismatch between tokens generated during H5P
integration setup and the token checks when posting answers in embeds
parent 33d38737
No related branches found
No related tags found
No related merge requests found
...@@ -71,9 +71,6 @@ try { ...@@ -71,9 +71,6 @@ try {
$context = context_module::instance($cm->id); $context = context_module::instance($cm->id);
require_capability('mod/hvp:view', $context); require_capability('mod/hvp:view', $context);
// Unlock session during embed.
core\session\manager::write_close();
// Set up view assets. // Set up view assets.
$view = new \mod_hvp\view_assets($cm, $course, [ $view = new \mod_hvp\view_assets($cm, $course, [
'disabledownload' => $disabledownload, 'disabledownload' => $disabledownload,
...@@ -82,6 +79,9 @@ $view = new \mod_hvp\view_assets($cm, $course, [ ...@@ -82,6 +79,9 @@ $view = new \mod_hvp\view_assets($cm, $course, [
$content = $view->getcontent(); $content = $view->getcontent();
$view->validatecontent(); $view->validatecontent();
// Release session while loading the rest of our assets.
core\session\manager::write_close();
// Configure page. // Configure page.
$PAGE->set_url(new \moodle_url('/mod/hvp/embed.php', array('id' => $id))); $PAGE->set_url(new \moodle_url('/mod/hvp/embed.php', array('id' => $id)));
$PAGE->set_title(format_string($content['title'])); $PAGE->set_title(format_string($content['title']));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment