diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index c0837e288..0b78b483c 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -541,7 +541,7 @@ class Lists extends WidgetBase /* * Apply sorting */ - if (($sortColumn = $this->getSortColumn()) && !$this->showTree && in_array($sortColumn, array_keys($this->getVisibleColumns()))) { + if (($sortColumn = $this->getSortColumn()) && !$this->showTree) { if (($column = array_get($this->allColumns, $sortColumn)) && $column->valueFrom) { $sortColumn = $this->isColumnPivot($column) ? 'pivot_' . $column->valueFrom @@ -1596,7 +1596,7 @@ class Lists extends WidgetBase return false; } - if ($this->sortColumn !== null) { + if ($this->sortColumn !== null && $this->isSortable($this->sortColumn)) { return $this->sortColumn; }