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

Issue #460: Locking session while saving large content #461

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from
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
10 changes: 10 additions & 0 deletions classes/view_assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ public function __construct($cm, $course, $options = []) {
private function getfilteredparameters() {
global $PAGE;

// If storing a file the session must be closed before closing the
// file with H5P content because file closure might take
// substantial time. This will allow other pages to use the session
// without waiting on the file operation to finish.
//
// NOTE: the method framework::messages() must not be called before
// the session is closed.
if (empty($this->content["filtered"]))
\core\session\manager::write_close();

$safeparameters = $this->core->filterParameters($this->content);
$decodedparams = json_decode($safeparameters);
$hvpoutput = $PAGE->get_renderer('mod_hvp');
Expand Down