From dffa0a9f401f8b73c0e8a90f67b78f81c797a369 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 20 Nov 2009 11:52:27 -0700 Subject: [PATCH] Bug #8520: Make sure sent mail folder exists if using drop-down selection on compose page --- imp/compose.php | 8 ++++++++ imp/docs/CHANGES | 2 ++ imp/lib/Views/Compose.php | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/imp/compose.php b/imp/compose.php index 8570ca1fb..8e7cc96b3 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -1101,6 +1101,14 @@ if ($redirect) { 'selected' => $sent_mail_folder ); $t->set('ssm_tabindex', ++$tabindex); + + /* Check to make sure the sent-mail folder is created - it needs + * to exist to show up in drop-down list. */ + $imp_folder = IMP_Folder::singleton(); + if (!$imp_folder->exists($sent_mail_folder)) { + $imp_folder->create($sent_mail_folder, true); + } + $t->set('ssm_folders', IMP::flistSelect($ssm_folder_options)); } else { if (!empty($sent_mail_folder)) { diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index 568b20991..93b5a3172 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -116,6 +116,8 @@ v5.0-git v4.3.6-cvs ---------- +[mms] Make sure sent-mail folders exist if using the drop-down selection list + on the compose page (Bug #8520). [mms] When replying to list, correctly extract e-mail address if multiple entries exist in the List-Post header (Bug #8719). [mms] For messages marked as innocent but not moved to Inbox, don't report diff --git a/imp/lib/Views/Compose.php b/imp/lib/Views/Compose.php index 478a3ea46..e64f350f4 100644 --- a/imp/lib/Views/Compose.php +++ b/imp/lib/Views/Compose.php @@ -95,6 +95,15 @@ class IMP_Views_Compose if (!empty($GLOBALS['conf']['user']['select_sentmail_folder']) && !$GLOBALS['prefs']->isLocked('sent_mail_folder')) { $imp_folder = IMP_Folder::singleton(); + + /* Check to make sure the sent-mail folders are created - they + * need to exist to show up in drop-down list. */ + foreach ($identities as $val) { + if (!$imp_folder->exists($val[3])) { + $imp_folder->create($val[3], true); + } + } + $flist = array(); foreach ($imp_folder->flist() as $val) { $tmp = array('l' => $val['abbrev'], 'v' => $val['val']); -- 2.11.0