6.0.0-beta1
7/8/25

[#7739] Folders tree not updated after an add (new) folder action
Summary Folders tree not updated after an add (new) folder action
Queue DIMP
Queue Version 1.1
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester emeric.jhelil (at) univ-lemans (dot) fr
Created 11/29/2008 (6065 days ago)
Due
Updated 12/11/2008 (6053 days ago)
Assigned 11/30/2008 (6064 days ago)
Resolved 12/10/2008 (6054 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
12/11/2008 09:19:13 AM emeric (dot) jhelil (at) univ-lemans (dot) fr Comment #4 Reply to this comment
- I have directly patched the two concerned files with IMP-4.3.

- I have replaced IMP-4.3 by IMP-4.3.1

The changes you made work perfectly in the two case.



Thanks.
12/10/2008 05:13:25 AM Michael Slusarz Comment #3
State ⇒ Resolved
Reply to this comment
Fixed in IMP 4.3.1.
11/30/2008 10:55:16 AM Jan Schneider Assigned to Michael Slusarz
State ⇒ Assigned
 
11/29/2008 04:53:41 PM emeric (dot) jhelil (at) univ-lemans (dot) fr Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Folders tree not updated after an add (new) folder action
Queue ⇒ DIMP
Milestone ⇒
Patch ⇒ Yes
New Attachment: dimp_addfolder.patch Download
State ⇒ Unconfirmed
Reply to this comment
Installation infos : horde-webmail-1.2 ; php-5.2.6 ; debian etch

Tested web browsers : Mozilla firefox 2.0.0.18, IE7, Safari 3.2 for 
windows (all on OS windows XP SP3)



By Dimp interface, after the creation of a new folder, I don't see the 
new folder dynamically added to the folders tree.

I need to refresh the page to see the new folder in the folders tree.



I remarked that this behaviour doesn't occur when I have another 
virtual folder in addition to the virtual inbox.



For instance, I try to create the folder "foo".

If I have no other virtual folder but the virtual inbox, then :

- I get the message 'The folder "foo" was successfully created'.

But :

- The folder "foo" doesn't appear in the folders tree.



Setting the javascript debugging and using dimp/js/src produces an alert :

with Firefox 2.0.0.18 :

  doActionComplete callback: TypeError-$(elt) has no properties

with IE7

   doActionComplete callback: TypeError-'null' is null or not an object



Refreshing the page corrects the situation :

- The folder "foo" appears successfully in the folders tree.



So, if I have created a virtual folder by Imp interface, then when I 
connect to the webmail by Dimp interface, a new created folder 
dynamically appears in the folders tree without refreshing the page.



I don't know if it's due to my configuration (admin config ? or user 
config ?).



I tried to understand and it seems to be caused by the virtual folders.

The getFolderResponse (horde/dimp/lib/DIMP.php) result contains the 
new folder in the array a but the "Virtual Folders%" in the array c too.

Then it makes the _folderCallback function 
(horde/dimp/js/src/DimpBase.js) fails when it manages the changed 
folders. And it doesn't continue managing the added folders.

More precisely :

_folderCallback calls

   changeFolder which calls

     deleteFolderElt sets f to null by the instruction

       var f = $(fid); (because there is no fldVirtual_Folders_) then calls

       DimpCore.removeMouseEvents(f) which wraps

         DimpBase._removeMouseEvents which fails on the instruction

           var d, id = $(elt).readAttribute('id'); with elt that is null



I think that it is linked to the re-creation of the virtual folders. 
After the deletion of the virtual inbox, its parent folder is empty. 
So during the re-creation of the virtual inbox, its parent is marked 
"changed" and it finishes to appear in the changed folders.



If I am not on a wrong trail, a part of the calls is :

with Folder as horde/imp/lib/Folder.php, Search as 
horde/imp/lib/Search.php, Tree as horde/imp/lib/IMAP/Tree.php

Folder.create calls

   Search.sessionSetup(true) which calls

     Search.createVINBOXFolder which calls

       Search.addVFolder (by the else branch of if (empty($vinbox_id)) 
) which calls

         Search._updateIMPTree(add... which calls

           Tree.insertVFolders which calls

             Tree.insert which calls

               Tree._insertElt which sets

                 $this-->_eltdiff[$elt['p']]['changed'] = true; 
(because its parent is empty)



I tried a modification to prevent the getFolderResponse result to 
contain the virtual folders in the changed folders array c.

I modified horde/dimp/lib/DIMP.php (v1.110.2.32) :

please see attached patch dimp_addfolder.patch.



It corrects the problem : without any other virtual folders but the 
virtual inbox, the creation of a new folder is dynamically added to 
the folders tree with Dimp interface.

It works on all the tested web browsers mentionned above.



Moreover, during my tries, I remarked in horde/imp/lib/IMAP/Tree.php 
(v 1.25.2.60), the function delete uses the instruction :

$vfolder_base = ($id == IMPTREE_VFOLDER_LABEL);

but shouldn't it be ?

$vfolder_base = ($id == IMPTREE_VFOLDER_KEY);

Because when I logged the function, it seems to be the key and not the 
label that was used.



Thanks for reading and help.

Saved Queries