MDL-55906 table: Update user preferences table when reset preferences

This commit is contained in:
Ilya Tregubov
2016-12-08 15:02:04 +11:00
parent e6cb76dfbb
commit b6b38f77ba
+6 -1
View File
@@ -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])) {