mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-73317 search: Close session later in script
The session write_close was moved to the earliest point in the script that does not modify the session. This is currently always after $OUTPUT->header()
This commit is contained in:
parent
49c4cfb2d5
commit
f106babf53
@ -48,9 +48,6 @@ if (!empty($CFG->forcelogin)) {
|
||||
require_login();
|
||||
}
|
||||
|
||||
// Unlock the session during a search.
|
||||
\core\session\manager::write_close();
|
||||
|
||||
require_capability('moodle/search:query', $context);
|
||||
|
||||
$searchrenderer = $PAGE->get_renderer('core_search');
|
||||
@ -169,6 +166,9 @@ $PAGE->set_url($url);
|
||||
// We are ready to render.
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Unlock the session only after outputting the header as this modifies the session cachestore.
|
||||
\core\session\manager::write_close();
|
||||
|
||||
// Get the results.
|
||||
if ($data) {
|
||||
$results = $search->paged_search($data, $page);
|
||||
|
Loading…
x
Reference in New Issue
Block a user