From e68135ff0f697b0a22e93fa23b3239d0dbc5eb54 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 2 Jun 2009 13:30:33 -0600 Subject: [PATCH] Bug #7296: Convert old IMP 4 sortby pref values --- imp/lib/IMP.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 40ff18704..94a97d8a4 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -1106,8 +1106,18 @@ class IMP $sortpref = @unserialize($GLOBALS['prefs']->getValue('sortpref')); $entry = (isset($sortpref[$prefmbox])) ? $sortpref[$prefmbox] : array(); + if (!isset($entry['b'])) { + $sortby = $GLOBALS['prefs']->getValue('sortby'); + /* IMP 4 upgrade: check for old, non-existent sort values. + * See Bug #7296. */ + if ($sortby > 10) { + $sortby = Horde_Imap_Client::SORT_ARRIVAL; + $GLOBALS['prefs']->setValue($sortby); + } + } + $ob = array( - 'by' => isset($entry['b']) ? $entry['b'] : $GLOBALS['prefs']->getValue('sortby'), + 'by' => isset($entry['b']) ? $entry['b'] : $sortby, 'dir' => isset($entry['d']) ? $entry['d'] : $GLOBALS['prefs']->getValue('sortdir'), 'limit' => false ); -- 2.11.0