Skip to content

Commit 5791c78

Browse files
committed
Remove specific view online event for the old post controller
1 parent f961cca commit 5791c78

2 files changed

Lines changed: 2 additions & 27 deletions

File tree

event/listener.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,8 @@ public function adjust_quickmod_tools($event)
279279
*/
280280
public function viewonline_ideas($event)
281281
{
282-
if ($event['on_page'][1] === 'app')
283-
{
284-
if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/ideas/post') === 0)
285-
{
286-
$event['location'] = $this->language->lang('POSTING_NEW_IDEA');
287-
$event['location_url'] = $this->helper->route('phpbb_ideas_index_controller');
288-
}
289-
else if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/ideas') === 0)
290-
{
291-
$event['location'] = $this->language->lang('VIEWING_IDEAS');
292-
$event['location_url'] = $this->helper->route('phpbb_ideas_index_controller');
293-
}
294-
}
295-
else if ($event['on_page'][1] === 'viewtopic' && $event['row']['session_forum_id'] == $this->config['ideas_forum_id'])
282+
if (($event['on_page'][1] === 'app' && strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/ideas') === 0) ||
283+
($event['on_page'][1] === 'viewtopic' && $event['row']['session_forum_id'] == $this->config['ideas_forum_id']))
296284
{
297285
$event['location'] = $this->language->lang('VIEWING_IDEAS');
298286
$event['location_url'] = $this->helper->route('phpbb_ideas_index_controller');

tests/event/listener_test.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,6 @@ public function viewonline_data()
215215
'phpbb_ideas_index_controller#a:0:{}',
216216
'VIEWING_IDEAS',
217217
),
218-
// test when on_page is app and session_page is for ideas/post
219-
array(
220-
array(
221-
1 => 'app',
222-
),
223-
array(
224-
'session_page' => 'app.' . $phpEx . '/ideas/post'
225-
),
226-
'$location_url',
227-
'$location',
228-
'phpbb_ideas_index_controller#a:0:{}',
229-
'POSTING_NEW_IDEA',
230-
),
231218
// test when viewing an idea topic (any topic in forum id 2)
232219
array(
233220
array(

0 commit comments

Comments
 (0)