From 61129b48ec229c4fae7dd55339007f82bb55998e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20K=C3=BCndig?= Date: Fri, 29 Nov 2019 08:26:37 +0100 Subject: [PATCH] Only put sortOptions to the session if the List query succeeded --- modules/backend/widgets/Lists.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index c4bfd4f43..862e96d40 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -1496,14 +1496,20 @@ class Lists extends WidgetBase $this->sortColumn = $sortOptions['column'] = $column; - $this->putSession('sort', $sortOptions); - /* * Persist the page number */ $this->currentPageNumber = post('page'); - return $this->onRefresh(); + /* + * Try to refresh the list with the new sortOptions. Put the + * new sortOptions in to the session if the query succeeded. + */ + $result = $this->onRefresh(); + + $this->putSession('sort', $sortOptions); + + return $result; } }