Tags:
create new tag
view all tags

Bug: %Search messes up current directory

The %SEARCH% command (when executed with scope=text) changes the current directory. Subsequently, any load of a used file does not work any more, as @INC assumes a given current directory (it assumes that we are running in the bin directory). Any plugin which loads its code in a lazy manner fails after such search command is executed.

Test case

Generate a topic that uses such search and then does a relevant plugin tag (e.g., FormQueryPlugin).

Environment

TWiki version: TWikiRelease02Sep2004

-- ThomasWeigert - 23 Jun 2005

Impact and Available Solutions

Follow up

Fix record

Discussion

@INC assumes a given current directory (it assumes that we are running in the bin directory)

it does??? are you sure? i thought that's why $twikiLibPath needed to be an absolute path... (although in DakarRelease, $twikiLibPath defaults to $twikiLibPath = Cwd::abs_path( "../lib" ) )

-- WillNorris - 23 Jun 2005

All I can say is that in my Cairo release this causes trouble. There is also no $twikiLibPath in Cairo...

-- ThomasWeigert - 24 Jun 2005

you mean this one in bin/setlib.cfg doesn't exist?

# -------------- Change these settings if required

#    Path to lib directory containing TWiki.pm.
#    ATTENTION: Set to absolute file path:
$twikiLibPath = '../lib';

-- WillNorris - 24 Jun 2005

Boy, I never realized that you needed to edit the bin/setlib.cfg directory... I wonder how many are aware of that...

-- ThomasWeigert - 25 Jun 2005

This was reported earlier. A fix would mean to fiddle around with changing directories, which would slow down TWiki. Since this is a one time install thingy we should not fix this.

-- PeterThoeny - 26 Jun 2005

it's already been fixed in DakarRelease (well, fixed in the sense of defaults provide an absolute directory path, not fixed in the sense of fiddling around with changing directories).

-- WillNorris - 26 Jun 2005

I eliminated the chdir from the code in DEVELOP, without really being aware of this bug. AFAIK the DEVELOP code never changes the directory for any reason, and never uses relative paths either, except on startup where '.' has to be on the path in order to find setlib.cfg. On the assumption that DEVELOP is the codebase for DakarRelease we should mark this as fixed.

-- CrawfordCurrie - 26 Jun 2005

Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2005-06-26 - CrawfordCurrie
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.