Only put sortOptions to the session if the List query succeeded

This commit is contained in:
Tobias Kündig 2019-11-29 08:26:37 +01:00
parent 7e98e199a4
commit 61129b48ec

View File

@ -1496,14 +1496,20 @@ class Lists extends WidgetBase
$this->sortColumn = $sortOptions['column'] = $column; $this->sortColumn = $sortOptions['column'] = $column;
$this->putSession('sort', $sortOptions);
/* /*
* Persist the page number * Persist the page number
*/ */
$this->currentPageNumber = post('page'); $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;
} }
} }