summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Core/User/UserSession.php2
-rw-r--r--tests/units/Core/User/UserSessionTest.php2
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));