The PSGI engine should be able to bootstrap itself even when there's no initial
LocalSite.cfg
. But when I keep all default settings as provided and go to the "TWiki front page" as soon as this option is offered, then TWiki fails with "Template 'oopsattention' not found".
To reproduce in SVN checkout,
- Delete (or better: play it safe and rename
) lib/LocalSite.cfg
- Start the PSGI engine with
plackup -Ilib psgi/twiki.psgi
(of course, you need to have plackup available and TWiki:Plugins.PSGIEngineContrib
pseudo-installed)
- Point your browser to
http://localsite:5000
- Enter configure passwords and hit "Next"
- On the next screen, keep all settings and hit "Next"
- On the next screen, follow the link "Go to the TWiki front page"
- Ouch!
A workaround is to "Return to configuration" once more, and again hit "Next" without changing anything. After hitting "Next" the front page just works.
Root cause: In the initial configuration
TWiki.spec
the
{TemplatePath}
variable references
$TWiki::cfg{TemplateDir}
which doesn't get evaluated in the first round of configuration, when TWiki just tries to get the directory paths right. On the second round the directory paths are set, and
{TemplatePath}
is evaluated.
Action item: The engine should figure out when it is safe to evaluate
{TemplatePath}
and just do it before saving
LocalSite.cfg
.
BTW: The Windows personal edition is based on PSGI but doesn't have this problem since it ships with an initial
LocalSite.cfg
.
--
TWiki:Main/HaraldJoerg
- 2016-08-11