Skip to content

Commit 2b9c4aa

Browse files
authored
Merge pull request #1774 from mercihabam/restore-combined-search
fix(frontend/backend): restore search in combined views
2 parents 4e7e9ca + 1f960b8 commit 2b9c4aa

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

modules/core/output_modules.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,7 @@ class Hm_Output_message_list_heading extends Hm_Output_Module {
19621962
*/
19631963
protected function output() {
19641964
$search_field = '';
1965-
$terms = $this->get('search_terms', '');
1965+
$terms = $this->get('list_keyword', '');
19661966
if ($this->get('custom_list_controls', '')) {
19671967
$config_link = $this->get('custom_list_controls');
19681968
$source_link = '';
@@ -1978,10 +1978,7 @@ protected function output() {
19781978
}
19791979
$config_link = '<a title="'.$this->trans('Configure').'" href="?page=settings#'.$path.'_setting"><i class="bi bi-gear-wide refresh_list"></i></a>';
19801980
$refresh_link = '<a class="refresh_link" title="'.$this->trans('Refresh').'" href="#"><i class="bi bi-arrow-clockwise refresh_list"></i></a>';
1981-
//$search_field = '<form method="GET">
1982-
//<input type="hidden" name="page" value="message_list" />
1983-
//<input type="hidden" name="list_path" value="'.$this->html_safe($this->get('list_path')).'"/>
1984-
//<input required type="search" placeholder="'.$this->trans('Search').'" id="search_terms" class="imap_keyword" name="search_terms" value="'.$this->html_safe($terms).'"/></form>';
1981+
$search_field = '<form method="GET"><input type="hidden" name="page" value="message_list" /><input type="hidden" name="list_path" value="'.$this->html_safe($this->get('list_path')).'"/><input required type="search" placeholder="'.$this->trans('Search').'" id="search_terms" class="form-control imap_keyword" name="keyword" value="'.$this->html_safe($terms).'"/></form>';
19851982

19861983
}
19871984
else {

modules/imap/handler_modules.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,6 @@ public function process() {
541541
}
542542
}
543543
$this->out('custom_list_controls_type', $custom_link);
544-
if (array_key_exists('keyword', $this->request->get)) {
545-
$this->out('list_keyword', $this->request->get['keyword']);
546-
}
547544
if (array_key_exists('filter', $this->request->get)) {
548545
if (in_array($this->request->get['filter'], array('all', 'unseen', 'seen',
549546
'answered', 'unanswered', 'flagged', 'unflagged'), true)) {
@@ -605,6 +602,10 @@ public function process() {
605602
} elseif ($default_sort_order = $this->user_config->get('default_sort_order_setting', false)) {
606603
$this->out('list_sort', $default_sort_order);
607604
}
605+
606+
if (array_key_exists('keyword', $this->request->get)) {
607+
$this->out('list_keyword', $this->request->get['keyword']);
608+
}
608609
}
609610
}
610611
}
@@ -1359,6 +1360,11 @@ public function process() {
13591360

13601361
$terms = [[search_since_based_on_setting($this->user_config), $date]];
13611362

1363+
if ($this->request->get['keyword']) {
1364+
$keyword = validate_search_terms($this->request->get['keyword']);
1365+
$terms[] = [validate_search_fld(DEFAULT_SEARCH_FLD), $keyword];
1366+
}
1367+
13621368
$messages = [];
13631369
$status = [];
13641370
foreach ($ids as $key => $id) {

0 commit comments

Comments
 (0)