MDL-55906 table: Update user preferences table when reset preferences
This commit is contained in:
+6
-1
@@ -449,8 +449,10 @@ class flexible_table {
|
||||
// Load any existing user preferences.
|
||||
if ($this->persistent) {
|
||||
$this->prefs = json_decode(get_user_preferences('flextable_' . $this->uniqueid), true);
|
||||
$oldprefs = $this->prefs;
|
||||
} else if (isset($SESSION->flextable[$this->uniqueid])) {
|
||||
$this->prefs = $SESSION->flextable[$this->uniqueid];
|
||||
$oldprefs = $this->prefs;
|
||||
}
|
||||
|
||||
// Set up default preferences if needed.
|
||||
@@ -463,7 +465,10 @@ class flexible_table {
|
||||
'textsort' => $this->column_textsort,
|
||||
);
|
||||
}
|
||||
$oldprefs = $this->prefs;
|
||||
|
||||
if (!isset($oldprefs)) {
|
||||
$oldprefs = $this->prefs;
|
||||
}
|
||||
|
||||
if (($showcol = optional_param($this->request[TABLE_VAR_SHOW], '', PARAM_ALPHANUMEXT)) &&
|
||||
isset($this->columns[$showcol])) {
|
||||
|
||||
Reference in New Issue
Block a user