6.0.0-beta1
9/2/25

[#7792] DIMP fails to render the IMAP folder list when subfolders exist
Summary DIMP fails to render the IMAP folder list when subfolders exist
Queue DIMP
Queue Version 1.1
Type Bug
State Resolved
Priority 2. Medium
Owners slusarz (at) horde (dot) org
Requester gunnar.beutner (at) hetzner (dot) de
Created 12/20/2008 (6100 days ago)
Due
Updated 12/21/2008 (6099 days ago)
Assigned 12/20/2008 (6100 days ago)
Resolved 12/21/2008 (6099 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
12/21/2008 05:55:36 AM Michael Slusarz State ⇒ Resolved
 
12/20/2008 09:03:47 PM gunnar (dot) beutner (at) hetzner (dot) de Comment #4 Reply to this comment
The changed getFolderId() method from revision 1.1.2.116 does in fact 
fix my problem. Here's a transcript of my debugging session with 
Google Chrome's JavaScript debugger:



Using the pre-1.1.2.116 code:



$ break DimpBase.js:1574

set breakpoint #1

paused at breakpoint 1: #<an Object>.createFolder(ob=#<an Object>, 5), 
https://some-server/dimp/js/DimpBase.js

1574:                 parent_e = (parent_e) ? parent_e.down('UL') : 
$('normalfolders');

$ p parent_e

#<an HTMLLIElement>

$ p parent_e.down('UL')

undefined

$ p parent_e.innerHTML

<ul></ul>



Using the getFolderId()-function from rev. 1.1.2.116:



paused at breakpoint 1: #<an Object>.createFolder(ob=#<an Object>, 5), 
https://some-server/dimp/js/DimpBase.js

1574:                 parent_e = (parent_e) ? parent_e.down('UL') : 
$('normalfolders');

$ p parent_e

#<an HTMLLIElement>

$ p parent_e.down('UL')

#<an HTMLUListElement>

$ p parent_e.innerHTML

<ul></ul>



Oddly enough the <ul>-element actually exists in both cases, but for 
some reason the down() method can't seem to navigate to it.


12/20/2008 07:04:17 PM Michael Slusarz Comment #3
State ⇒ Feedback
Reply to this comment
I can't reproduce this either with this code or with the slightly 
different way we calculate the folder ID in HEAD.  I've gone ahead and 
backported the change from HEAD into DIMP 1.1.1 - let me know if that 
fixes things for you (see commit message contained in this ticket's 
history).
12/20/2008 03:56:45 PM Chuck Hagenbuch State ⇒ Assigned
Assigned to Michael Slusarz
 
12/20/2008 10:45:14 AM gunnar (dot) beutner (at) hetzner (dot) de Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ DIMP fails to render the IMAP folder list when subfolders exist
Queue ⇒ DIMP
Milestone ⇒
Patch ⇒ Yes
New Attachment: dimp-subfolder-fix.patch Download
State ⇒ Unconfirmed
Reply to this comment
When rendering the folder list in DIMP the following HTML code is generated:



<li ftype="folder" mbox="INBOX.Foldername" l="Foldername" 
id="fldINBOX.Foldername" class="folder">

        <div id="fldINBOX.Foldername_div" class="exp">

        </div>



        <a title="Foldername" id="fldINBOX.Foldername_label">Foldername</a>

</li>



<li style="display: none;" id="subfldINBOX.Foldername" class="subfolders">

        <ul>

        [...]

        </ul>

</li>



Later on DIMP tries to find the <ul>-tag in order to add subfolders. 
However - using certain browsers like Google Chrome and Safari - the 
code that is responsible for finding the <ul>-tag returns 'undefined' 
which causes the entire folder list to not be shown at all (the 
"Loading..." <div> is shown instead):



DimpBase.js, line 1574:

parent_e = (parent_e) ? parent_e.down('UL') : $('normalfolders');



parent_e is set, however parent_e.down('UL') returns undefined.



Changing the function that is responsible for the id names of the HTML 
tags so that dots in the folder names are replaced with underscores 
appears to solve this problem.

Saved Queries