From 245d08ddc7d2f1b0d72eee0b3f96ebc164534899 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 19 Jan 2011 22:00:27 -0700 Subject: [PATCH] Bug #9349: Fix new subfolder doesn't show in folder list Problem only occurred if all (unsubscribed) folders are viewed. hasChildren() was always returning true because we created the parent element before making the initial hasChildren() check. Need to check for children before this. --- imp/lib/Imap/Tree.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imp/lib/Imap/Tree.php b/imp/lib/Imap/Tree.php index 2efbf4e0e..fdd795999 100644 --- a/imp/lib/Imap/Tree.php +++ b/imp/lib/Imap/Tree.php @@ -557,15 +557,15 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable $this->changed = true; + $prev = ($this->_trackdiff && !is_null($this->_eltdiff) && !isset($this->_eltdiff['a'][$elt['p']])) + ? $this->hasChildren($this->_tree[$elt['p']]) + : null; + /* Set the parent array to the value in $elt['p']. */ if (empty($this->_parent[$elt['p']])) { $this->_parent[$elt['p']] = array(); } - $prev = ($this->_trackdiff && !is_null($this->_eltdiff) && !isset($this->_eltdiff['a'][$elt['p']])) - ? $this->hasChildren($this->_tree[$elt['p']]) - : null; - $this->_parent[$elt['p']][] = $elt['v']; $this->_tree[$elt['v']] = $elt; -- 2.11.0