[pmwiki-users] Empty $pagename (Was: variables for customization)
chr at home.se
chr at home.se
Thu Jul 7 17:27:31 CDT 2005
On Thu, 7 Jul 2005, Patrick R. Michaud wrote:
> > > Consider the following url:
> > >
> > > http://www.example.com/pmwiki/pmwiki.php
> > >
> > > What value should $group and $name have when local/config.php is
> > > called...? And should scripts/recipes rely on those values?
> >
> > Um... I'd expect $group to be assigned according to
> >
> > $group = FmtPageName("$Group", $pagename);
> >
> > which ought to be well defined even when accessing
> >
> > http://www.example.com/pmwiki/pmwiki.php
> >
> > Or am I missing something?
>
> Yes.
>
> Since the url doesn't have a pagename in it, $pagename isn't
> set to a value (or it's a null string). It will eventually be set
> to the value of $DefaultPage, which in turn will be set based upon
> the values of $DefaultGroup and $DefaultName. However, those values
> can't be known until *after* local/config.php has been loaded, so
> $pagename isn't set (by PmWiki) until then.
Oh.. this might explain quite a few bugs actually. I'm guessing this is
not a fact that's well known... PmWiki.BasicVariables could do with a
note about this as well. Would you say that $pagename deserves it's own
page just like FmtPageName()?
What's the recommended way for scripts to deal with this? (I'm talking
about scripts that might be invoked by config.php)
/Christian
--
Christian Ridderström, +46-8-768 39 44 http://www.md.kth.se/~chr
More information about the pmwiki-users
mailing list