MDL-68462 core_table: add missing global
authorSimey Lameze <simey@moodle.com>
Wed, 6 May 2020 06:11:48 +0000 (14:11 +0800)
committerAdrian Greeve <abgreeve@gmail.com>
Wed, 6 May 2020 06:40:33 +0000 (14:40 +0800)
lib/tablelib.php

index 8a13164..6cb2a6b 100644 (file)
@@ -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));