<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Folders tree not updated after an add (new) folder action</title> 
  <pubDate>Fri, 10 Apr 2026 14:37:24 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7739</link> 
  <atom:link rel="self" type="application/rss+xml" title="Folders tree not updated after an add (new) folder action" href="https://bugs.horde.org/ticket/7739/rss" /> 
  <description>Folders tree not updated after an add (new) folder action</description> 
 
   
   
  <item> 
   <title>Installation infos : horde-webmail-1.2 ; php-5.2.6 ; debian </title> 
   <description>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&#039;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&#039;t occur when I have another virtual folder in addition to the virtual inbox.



For instance, I try to create the folder &quot;foo&quot;.

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

- I get the message &#039;The folder &quot;foo&quot; was successfully created&#039;.

But :

- The folder &quot;foo&quot; doesn&#039;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-&#039;null&#039; is null or not an object



Refreshing the page corrects the situation :

- The folder &quot;foo&quot; 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&#039;t know if it&#039;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 &quot;Virtual Folders%&quot; 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&#039;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(&#039;id&#039;); 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 &quot;changed&quot; 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--&gt;_eltdiff[$elt[&#039;p&#039;]][&#039;changed&#039;] = 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&#039;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.</description> 
   <pubDate>Sat, 29 Nov 2008 16:53:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7739#t51004</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/imp/docs/CHANGES?r1=1.699.2.362&amp;r2=1.699.2.363&amp;ty=u
http://cvs.horde.org/diff.php/imp/lib/IMAP/Tree.php?r1=1.25.2.63&amp;r2=1.25.2.64&amp;ty=u
http://cvs.horde.org/diff.php/imp/lib/Search.php?r1=1.37.10.45&amp;r2=1.37.10.46&amp;ty=u</description> 
   <pubDate>Wed, 10 Dec 2008 05:13:12 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7739#t51176</link> 
  </item> 
   
  <item> 
   <title>Fixed in IMP 4.3.1.</title> 
   <description>Fixed in IMP 4.3.1.</description> 
   <pubDate>Wed, 10 Dec 2008 05:13:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7739#t51177</link> 
  </item> 
   
  <item> 
   <title>- I have directly patched the two concerned files with IMP-4</title> 
   <description>- 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.</description> 
   <pubDate>Thu, 11 Dec 2008 09:19:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7739#t51192</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
