6.0.0-alpha12
6/11/25

[#3744] isVINBOXFolder's sense is reversed
Summary isVINBOXFolder's sense is reversed
Queue IMP
Queue Version 4.1
Type Bug
State Resolved
Priority 2. Medium
Owners
Requester dustin (at) ywlcs (dot) org
Created 04/07/2006 (7005 days ago)
Due
Updated 04/07/2006 (7005 days ago)
Assigned
Resolved 04/07/2006 (7005 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/07/2006 07:11:45 PM Michael Slusarz Comment #2
State ⇒ Resolved
Reply to this comment
04/07/2006 06:35:09 PM dustin (at) ywlcs (dot) org Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ isVINBOXFolder's sense is reversed
Queue ⇒ IMP
Reply to this comment
I just upgraded from IMP 4.0.1 to 4.1, and I'm having problems with 
the "Hide Deleted Messages" link not appearing for users.



I've narrowed it down to a problem with isVINBOXFolder.  As I 
understand it, this function should detect when the currently 
displayed mailbox is the virtual INBOX, and thus should not allow 
deleted messages to be shown (see 
http://thread.gmane.org/gmane.comp.horde.imp/20320/focus=20352).   
However, it's doing just the opposite -- it's calling all regular IMAP 
folders virtual inboxes, and not calling my single (auto-created) 
virtual mailbox a virtual inbox (thus allowing me to hide/show deleted 
messages there).



All of our users have pref vinbox_id='', as that's the default.  I 
tried deleting those prefs, and they came right back.  I think the 
problem in isVINBOXFolder is that when the current folder's ID is 
null, and the pref is '', they compare as equal.  I think the reason 
it's not getting set is here, in createVINBOXFolder (imp/Search.php):

<pre>

         if (empty($vinbox_id)) {

             $vtrash_id = $this->addVFolder($query, $flist, array(), $label);

             $GLOBALS['prefs']->setValue('vinbox_id', $vinbox_id);

             $_SESSION['imp']['search']['vinbox_id'] = $vinbox_id;

         } else {

             $vtrash_id = $this->addVFolder($query, $flist, array(), 
$label, $vinbox_id);

         }

</pre>

where the second line should assign to vinbox_id instead of vtrash_id 
(looks like a copy-paste error..)



Thoughts?

Saved Queries