[pmwiki-users] Category.Categories ?

Peter Bowers pbowers at pobox.com
Mon Nov 23 09:53:42 CST 2015


On Mon, Nov 23, 2015 at 10:20 AM, Peter Bowers <pbowers at pobox.com> wrote:

> Hmmm... Even after I do this I find that MakePageName() is forcing the
> pagename to be GroupTest.GroupTest instead of GroupTest.Xyz. Shouldn't it
> be paying attention to the $DefaultName? I find this true regardless of
> whether I go to a url (?n=GroupTest or ?n=GroupTest.) or if I use an
> in-markup link ([[GroupTest.]]). Is this something I should put in PITS or
> am I not understanding how default group names are supposed to work or is
> something messed up in my system?



Ah, I see - at least part of it based on whether the new page (named in
$DefaultName) exists.

Thus if I have this set early in my farmconfig.php:

$DefaultName='Xyz';

*And the page exists*

then I can confirm that it goes to GroupTest.Xyz when I use the address bar
to access either ?n=GroupTest or ?n=GroupTest. (with or without the period).

Personally this seems PITS-worthy (i.e., a bug), but perhaps other sites
depend on this behavior for some use-case that's not occurring to me?

Oh, I did some research and discovered http://www.pmwiki.org/wiki/PITS/01220
-- now I read that it is by design, but I'd have to say this particular
design choice is particularly hard to understand intuitively. (That's rare
in pmwiki, but this seems to me to be so.) Anyway, I will update the docs
to try to help others not stumble over the nomenclature.

I have now updated
* http://www.pmwiki.org/wiki/PmWiki/BasicVariables
* http://www.pmwiki.org/wiki/PmWiki/PageVariables
* http://www.pmwiki.org/wiki/PmWiki/WikiGroup
* http://www.pmwiki.org/wiki/PmWiki/LocalCustomizations
* http://www.pmwiki.org/wiki/Cookbook/PagePaths

It would be good if someone reviewed my changes in case I have
misunderstood how these should be set or am being too detailed in the wrong
place.

Don, to resolve your problem (I believe) you need to do the following in
config.php or farmconfig.php (note: NOT in your per-group config script):

===(snip)===
if (preg_match('!^GroupTest(?:[./]|$)!', $pagename)) {
   $DefaultName = 'Xyz';
   $PagePathFmt = array('$Group.$1','$1.$DefaultName');
}
===(snip)===

After that any link to just GroupTest or GroupTest. or GroupTest/ will go
to GroupTest.Xyz and any ?n=GroupTest or ?n=GroupTest. or ?n=GroupTest/ in
the URL will also take you to ?n=GroupTest.Xyz.

I would also get rid of your setting of $Group and $Name within your group
config file - that seems like it would cause problems...

-Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20151123/cfe25752/attachment.html>


More information about the pmwiki-users mailing list