From 18af35d928956b3ebae636a0996add74d683bec8 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Thu, 30 Jul 2020 10:54:09 -0600 Subject: [PATCH] Prevent error from occurring when the active sorting column is hidden from the results. Fixes #5227 --- modules/backend/widgets/Lists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index bc83c11f6..51a425c2c 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -522,7 +522,7 @@ class Lists extends WidgetBase /* * Apply sorting */ - if (($sortColumn = $this->getSortColumn()) && !$this->showTree) { + if (($sortColumn = $this->getSortColumn()) && !$this->showTree && in_array($sortColumn, array_keys($this->getVisibleColumns()))) { if (($column = array_get($this->allColumns, $sortColumn)) && $column->valueFrom) { $sortColumn = $this->isColumnPivot($column) ? 'pivot_' . $column->valueFrom