diff options
author | Frédéric Guillot <fred@kanboard.net> | 2018-04-02 14:08:14 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2018-04-02 19:18:11 -0700 |
commit | c84378648f3dede4c30bea9a5e549dafd563adc7 (patch) | |
tree | 3401f40916842188f6e7bd6da88484207d4932f7 | |
parent | 5f7a3442d61b99e2fbad732bd0eaf9ad64398274 (diff) |
Fallback to "status:open" if there is no user filter
-rw-r--r-- | app/Core/User/UserSession.php | 2 | ||||
-rw-r--r-- | tests/units/Core/User/UserSessionTest.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/Core/User/UserSession.php b/app/Core/User/UserSession.php index d52e6c73..d5f851e6 100644 --- a/app/Core/User/UserSession.php +++ b/app/Core/User/UserSession.php @@ -223,7 +223,7 @@ class UserSession extends Base public function getFilters($projectID) { if (! session_exists('filters:'.$projectID)) { - return session_get('user')['filter']; + return session_get('user')['filter'] ?: 'status:open'; } return session_get('filters:'.$projectID); diff --git a/tests/units/Core/User/UserSessionTest.php b/tests/units/Core/User/UserSessionTest.php index 875eb959..498d5e7c 100644 --- a/tests/units/Core/User/UserSessionTest.php +++ b/tests/units/Core/User/UserSessionTest.php @@ -83,7 +83,7 @@ class UserSessionTest extends Base public function testFilters() { $userSession = new UserSession($this->container); - $this->assertEquals('', $userSession->getFilters(1)); + $this->assertEquals('status:open', $userSession->getFilters(1)); $_SESSION['user'] = array('filter' => 'status:open'); $this->assertEquals('status:open', $userSession->getFilters(1)); |