Login | Register
My pages Projects Community openCollabNet

Discussions > issues > [WebSVN issue] [Issue 345] New - Wrong directories drawn as "open"

websvn
Discussion topic

Back to topic list

[WebSVN issue] [Issue 345] New - Wrong directories drawn as "open"

Reply

Author ypnos
Full name Johannes Jordan
Date 2013-10-10 05:14:38 PDT
Message http://websvn.tigris​.org/issues/show_bug​.cgi?id=345
                 Issue #|345
                 Summary|Wrong directories drawn as "open"
               Component|websvn
                 Version|2.3.3
                Platform|All
              OS/Version|All
                     URL|
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P2
            Subcomponent|Unknown
             Assigned to|issues@websvn
             Reported by|ypnos






------- Additional comments from ypnos at tigris dot org Thu Oct 10 05:14:38 -0700 2013 -------
WebSVN has a feature to discern between open and closed directories. They are
called "dir" and "diropen" internally.

However, when a template assigns different icons to them, it is revealed that
the wrong directories are shown as "diropen".

It looks like this:

c folder 1
c folder 2
c folder 3
   c subfolder 1
   c subfolder 2
       file 1
       file 2
   o subfolder 3
   c subfolder 4
o folder 4
c folder 5
...


In listing.php, lines 115ff:
    $listing[$index]['filetype'] = ($openDir) ? 'diropen' : 'dir';
    $openDir = isset($subs[$level + 1]) && (!strcmp($subs[$level + 1].'/',
$file) || !strcmp($subs[$level + 1], $file));

we can see that the bool $openDir is set *after* setting the current filetype.
The bug is solved by flipping these two lines:

    $openDir = isset($subs[$level + 1]) && (!strcmp($subs[$level + 1].'/',
$file) || !strcmp($subs[$level + 1], $file));
    $listing[$index]['filetype'] = ($openDir) ? 'diropen' : 'dir';

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

[WebSVN issue] [Issue 345] New - Wrong directories drawn as "open" ypnos Johannes Jordan 2013-10-10 05:14:38 PDT
Messages per page: