From c0db61e45f1ec9ed8ecbf6cef086352e2068b506 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Wed, 6 May 2020 14:11:48 +0800 Subject: [PATCH] MDL-68462 core_table: add missing global --- lib/tablelib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tablelib.php b/lib/tablelib.php index 8a131644527..6cb2a6bbc90 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -514,7 +514,6 @@ class flexible_table { * @return type? */ function setup() { - global $SESSION; if (empty($this->columns) || empty($this->uniqueid)) { return false; @@ -1404,6 +1403,7 @@ class flexible_table { * Initialise table preferences. */ protected function initialise_table_preferences(): void { + global $SESSION; // Load any existing user preferences. if ($this->persistent) { @@ -1484,6 +1484,8 @@ class flexible_table { * @param array $oldprefs Old preferences to compare against. */ protected function save_preferences($oldprefs): void { + global $SESSION; + if ($this->prefs != $oldprefs) { if ($this->persistent) { set_user_preference('flextable_' . $this->uniqueid, json_encode($this->prefs));