From: Michael M Slusarz Date: Thu, 20 Jan 2011 05:00:27 +0000 (-0700) Subject: Bug #9349: Fix new subfolder doesn't show in folder list X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=245d08ddc7d2f1b0d72eee0b3f96ebc164534899;p=horde.git 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. --- 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;