Tags:
create new tag
, view all tags

Bug: Sidebar is constructed erroneously when non-web directories are present

When the data directory contains subdirectories that do not represent webs (e.g., a CVS directory), the side bar will show the name of the directory, a newline, and then a question mark. Clicking on the question mark will try to create a WebHome topic in that directory.

While the behavior of offering to create a WebHome topic might seem reasonable, probably it is not. If a directory does not contain a WebHome topic, likely it is not intended to be a Web. If somebody were to create a new web, they would usually copy over the files from the default web, rather than just creating an empty directory.

I would suggest that links are not created for subdirectories in data which do not contain a WebHome topic.

Test case

Environment

TWiki version: TWikiBetaRelease2004x10x30
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: WinXP
Web server: Apache 1.3.29
Perl version: 5.8.5
Client OS: WinXP
Web Browser: IE

-- ThomasWeigert - 27 Dec 2004

Follow up

sounds reasonable to me. just make sure to check for %HOMETOPIC% rather than a hard-coded WebHome

-- WillNorris - 03 May 2005

 

Fix record

SVN 4341:

Index: Store.pm
===================================================================
--- Store.pm    (revision 4340)
+++ Store.pm    (working copy)
@@ -1193,8 +1193,7 @@
     $filter ||= '';

     opendir DIR, "$TWiki::cfg{DataDir}" ;
-    my @webList = grep { !/^\./ &&
-                           -d "$TWiki::cfg{DataDir}/$_" } readdir( DIR );
+    my @webList = grep { -e "$TWiki::cfg{DataDir}/$_/WebHome.txt" } readdir( DIR );
     closedir( DIR );

     if ( $filter =~ /\buser\b/ ) {

CrawfordCurrie did a more extensive (and more proper) fix in SVN 4351

Topic revision: r6 - 2005-06-06 - 21:12:34 - WillNorris
 

Codev

share: Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon
Twiki, Inc.
This site is powered by the TWiki collaboration platform
Ideas, requests, problems regarding TWiki? Send feedback
Copyright © 1999-2010 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.