Item5473: Initial value of {TemplatePath} should copy setting of {TemplateDir}

Priority: Normal
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component: Configure
Reported By: TWiki:Main.ArthurClemens
Waiting For:
Last Change By: KennethLavrsen
This has cost me one hour of sweating and a Google search to find the answer in TWiki:Support.Perl5ErrorsTemplateProblem.

The inititial setting of {TemplatePath} contained cgi-bin so this resulted in a bogus path (with this provider the cgi-bin location is not where twiki is installed.

My suggestion is to create the initial value of {TemplatePath} based on {TemplateDir}.

And {MimeTypesFileName} should be based on {DataDir}.

-- TWiki:Main/ArthurClemens - 25 Mar 2008

It looks like it should. TWiki.spec says:
$TWiki::cfg{TemplatePath} = '$TWiki::cfg{TemplateDir}/$web/$name.$skin.tmpl, $TWiki::cfg{TemplateDir}/$name.$skin.tmpl, $TWiki::cfg{TemplateDir}/$web/$name.tmpl, $TWiki::cfg{TemplateDir}/$name.tmpl, $web.$skinSkin$nameTemplate, $TWiki::cfg{SystemWebName}.$skinSkin$nameTemplate, $web.$nameTemplate, $TWiki::cfg{SystemWebName}.$nameTemplate';

Perhaps something went wrong with my initial setup...

-- TWiki:Main/ArthurClemens - 25 Mar 2008

no, its one of the broken bits - the $TWiki::cfg{TemplateDir} bit is evaluated as it is written to the cfg file, and so when you later change {TemplateDir} configure doesn't have any way to know whats going on.

Unfortuanatly, we also can't just re-grab the {TemplatePath} from TWiki.spec as the user may have customised the {TemplatePath}.

Tis a problem, that may only be solveable by replacing the $TWiki::cfg{TemplateDir} with a non-perl based variable, that is then evaluated at when the cfg's are loaded into the running TWiki.

-- TWiki:Main.SvenDowideit - 30 Mar 2008

I'm not sure how {TemplatePath} comes to be saved with absolute paths in it in the first place. I intended that such "derived" variables should be expanded at run-time - hence the single quotes - but this seems to be broken.

The problem is with configure - this situation should never arise, IMHO.

-- CrawfordCurrie - 27 May 2008

Fixed on trunk

-- CrawfordCurrie - 06 Nov 2009

ItemTemplate edit

Summary Initial value of {TemplatePath} should copy setting of {TemplateDir}
ReportedBy TWiki:Main.ArthurClemens
SVN Range TWiki-5.0.0, Sun, 09 Mar 2008, build 16496
AppliesTo Engine
Component Configure
Priority Normal
CurrentState Closed
Checkins distro:a650adb36e47
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r8 - 04 Oct 2010, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy