MDL-69110 core: Unset the correct sort data element
authorJun Pataleta <jun@moodle.com>
Fri, 3 Jul 2020 16:47:14 +0000 (00:47 +0800)
committerJun Pataleta <jun@moodle.com>
Fri, 3 Jul 2020 16:47:14 +0000 (00:47 +0800)
lib/tablelib.php

index 8e28ab4..476fd9b 100644 (file)
@@ -1307,7 +1307,7 @@ class flexible_table {
             if (array_key_exists($sortby, $sortdata)) {
                 // This key already exists somewhere. Change its sortorder and bring it to the top.
                 //$sortorder = $sortdata[$sortby] = $sortorder;
-                unset($sortdata['sortby'][$sortby]);
+                unset($sortdata[$sortby]);
             }
             $sortdata = array_merge([$sortby => $sortorder], $sortdata);
         }