Skip to content

Commit e25dcbf

Browse files
authored
Merge pull request #299 from Leinad4Mind/fix-pagination-on-search
Fix pagination on search
2 parents e31669a + 462a2e2 commit e25dcbf

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

core/controller/search.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config
133133

134134
/**
135135
* Index Controller
136-
* Route: gallery/search
136+
* Route: gallery/search/{page}
137137
*
138138
* @param int $page
139139
* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
@@ -156,9 +156,10 @@ public function base($page = 1)
156156
$sort_days = $this->request->variable('st', 0);
157157
$sort_key = $this->request->variable('sk', 't');
158158
$sort_dir = $this->request->variable('sd', 'd');
159+
$filtered = $this->request->variable('filtered', false);
159160

160161
$start = ($page - 1) * $this->gallery_config->get('items_per_page');
161-
if ($keywords != '' && $add_keywords ='' )
162+
if ($filtered)
162163
{
163164
$submit = true;
164165
}
@@ -329,12 +330,13 @@ public function base($page = 1)
329330
'username' => $username,
330331
'user_id' => $user_id,
331332
'terms' => $search_terms,
332-
'aid' => $search_album,
333-
'sc' => $search_child,
334-
'sf' => $search_fields,
335-
'st' => $sort_days,
336-
'sk' => $sort_key,
337-
'sd' => $sort_dir
333+
'aid' => $search_album,
334+
'sc' => $search_child,
335+
'sf' => $search_fields,
336+
'st' => $sort_days,
337+
'sk' => $sort_key,
338+
'sd' => $sort_dir,
339+
'filtered' => true
338340
),
339341
), 'pagination', 'page', $search_count, $this->gallery_config->get('items_per_page'), $current_page - 1);
340342

0 commit comments

Comments
 (0)