From 2c33c7e38bc767330b4eebdc9e4d234caca72966 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Thu, 16 Jan 2014 09:41:19 -0500
Subject: [PATCH] Make message pagenav (prev/next) work with sorted multi-folder search results

---
 program/steps/mail/search.inc |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index 5ce9fe6..b45cdc0 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -114,6 +114,10 @@
     $RCMAIL->storage->search($mboxes, $search_str, $imap_charset, $sort_column);
 }
 
+// Get the headers
+$result_h = $RCMAIL->storage->list_messages($mbox, 1, $sort_column, rcmail_sort_order());
+$count    = $RCMAIL->storage->count($mbox, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL');
+
 // save search results in session
 if (!is_array($_SESSION['search'])) {
     $_SESSION['search'] = array();
@@ -124,10 +128,6 @@
     $_SESSION['last_text_search'] = $str;
 }
 $_SESSION['search_request'] = $search_request;
-
-// Get the headers
-$result_h = $RCMAIL->storage->list_messages($mbox, 1, $sort_column, rcmail_sort_order());
-$count    = $RCMAIL->storage->count($mbox, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL');
 
 // Add 'folder' column to list
 if ($_SESSION['search'][1]->multi) {

--
Gitblit v1.9.1