[dev] Re: IMAP_Tree broken

Michael M Slusarz slusarz at mail.curecanti.org
Tue Feb 22 14:29:00 PST 2005


Quoting Chuck Hagenbuch <chuck at horde.org>:

> Quoting Michael M Slusarz <slusarz at mail.curecanti.org>:
>
>> I would start with reset() in IMAP_Tree:: - namely, to see if 'INBOX'
>> is present in the tree at that time and if INBOX is correctly being
>> identified as the first element in the tree.
>
> It's in the tree, but not under $this->_tree[null] (using null as an
> array key doesn't seem like a very good idea, fwiw). The following diff
> to Tree.php gets my folders back, though now nothing is sorted, so I
> won't commit:
>
> @@ -698,7 +698,7 @@
>         }
>
>         if ($this->_mode == IMAPTREE_MODE_MAIL) {
> -            $this->_currkey = array_search('INBOX', $this->_tree[null]);
> +            $this->_currkey = array_search('INBOX', $this->_tree);
>         } else {
>             $this->_currkey = 0;
>         }
>
> That tell you anything? Things were working perfectly before rev 1.56.

I previously thought that using null was not a good idea either, but it 
turns out that this is the way we have been storing things in the base 
of the tree for a while now (even before rev 1.56). (There used to be a 
strval($key) conversion in _addLevel(), but this was inconsistent usage 
because we were using string(0) to access the base of the tree in some 
locations and used null in other locations.)

I'll take a deeper look and see if i come up with a fix.

michael

_______________________________________
Michael Slusarz [slusarz at curecanti.org]


More information about the dev mailing list