From adb660f1ad53abb0d8cbfa18db476747c9005dfe Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 24 Oct 2020 13:11:44 +0000 Subject: [PATCH 1/2] Issue 9451: We now do store the tab in a config again --- src/Module/Conversation/Network.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index abe836f27..ebccc0a3a 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -283,7 +283,7 @@ class Network extends BaseModule self::$forumContactId = $parameters['contact_id'] ?? 0; - self::$selectedTab = Session::get('network-tab', ''); + self::$selectedTab = Session::get('network-tab', DI::pConfig()->get(local_user(), 'network.view', 'selected_tab', '')); if (!empty($get['star'])) { self::$selectedTab = 'star'; @@ -297,8 +297,6 @@ class Network extends BaseModule self::$selectedTab = $get['order']; } - Session::set('network-tab', self::$selectedTab); - self::$star = intval($get['star'] ?? 0); self::$mention = intval($get['mention'] ?? 0); self::$order = $get['order'] ?? Session::get('network-order', 'commented'); @@ -306,7 +304,7 @@ class Network extends BaseModule self::$selectedTab = self::$selectedTab ?? self::$order; Session::set('network-tab', self::$selectedTab); - Session::set('network-order', self::$order); + DI::pConfig()->set(local_user(), 'network.view', 'selected_tab', self::$selectedTab); self::$accountTypeString = $get['accounttype'] ?? $parameters['accounttype'] ?? ''; self::$accountType = User::getAccountTypeByString(self::$accountTypeString); @@ -340,7 +338,12 @@ class Network extends BaseModule case 'uriid': self::$max_id = $get['last_uriid'] ?? self::$max_id; break; + default: + self::$order = 'commented'; + self::$max_id = $get['last_commented'] ?? self::$max_id; } + + Session::set('network-order', self::$order); } protected static function getItems(string $table, array $params, array $conditionFields = []) From 8bd45ab857e174382432fac0849111c8eb28fa46 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 24 Oct 2020 13:44:31 +0000 Subject: [PATCH 2/2] "commented" is the default --- src/Module/Conversation/Network.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index ebccc0a3a..b19f40902 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -329,9 +329,6 @@ class Network extends BaseModule case 'received': self::$max_id = $get['last_received'] ?? self::$max_id; break; - case 'commented': - self::$max_id = $get['last_commented'] ?? self::$max_id; - break; case 'created': self::$max_id = $get['last_created'] ?? self::$max_id; break;