From e576e8df0a59449aa36f0e0e1f71f4f1d973f3fb Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 27 Sep 2010 11:19:11 -0600 Subject: [PATCH] Fix bugs introduced with latest compose/contents changes --- imp/compose-dimp.php | 8 +++----- imp/lib/Ui/Compose.php | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index 6ddcea897..e705678bf 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -80,7 +80,7 @@ case 'reply_list': break; } - $reply_msg = $imp_compose->replyMessage($vars->type, reset($contents), $header['to']); + $reply_msg = $imp_compose->replyMessage($vars->type, $contents, $header['to']); $msg = $reply_msg['body']; $header = $reply_msg['headers']; $header['replytype'] = 'reply'; @@ -128,9 +128,7 @@ case 'forward_both': $rte = $show_editor = ($prefs->getValue('compose_html') && $_SESSION['imp']['rteavail']); } else { - if (!($contents = $imp_ui->getContents($vars))) { - break; - } + try { $contents = $imp_ui->getContents($vars); } catch (IMP_Compose_Exception $e) { @@ -162,7 +160,7 @@ case 'forward_both': case 'forward_redirect': try { $contents = $imp_ui->getContents($vars); - $imp_compose->redirectMessage(reset($contents)); + $imp_compose->redirectMessage($contents); $get_sig = false; $title = _("Redirect"); $vars->type = 'redirect'; diff --git a/imp/lib/Ui/Compose.php b/imp/lib/Ui/Compose.php index 5d341087f..70d657f66 100644 --- a/imp/lib/Ui/Compose.php +++ b/imp/lib/Ui/Compose.php @@ -219,7 +219,7 @@ class IMP_Ui_Compose */ public function getContents($vars = null) { - $ob = null; + $indices = $ob = null; if (is_null($vars)) { /* IMP: compose.php */ @@ -229,7 +229,7 @@ class IMP_Ui_Compose $indices = new IMP_Indices($vars->folder, $vars->uid); } - if (!is_null($ob)) { + if (!is_null($indices)) { try { $ob = $GLOBALS['injector']->getInstance('IMP_Contents')->getOb($indices); } catch (Horde_Exception $e) {} -- 2.11.0