01302: Link to group incorrectly directed to page PmWiki/group

Summary: Link to group incorrectly directed to page PmWiki/group
Created: 2012-10-29 03:58
Status: Closed - fixed for pmwiki.org
Category: Bug
From: simon
Assigned: 2.2.44
Priority: 5
Version:
OS:

Description:

The markup

[[http://www.pmwiki.org/wiki/Skins/]]

[[http://www.pmwiki.org/wiki/Skins]]

http://www.pmwiki.org/wiki/Skins/

http://www.pmwiki.org/wiki/Skins

 incorrectly opens http://www.pmwiki.org/wiki/PmWiki/Skins

it should open

[[http://www.pmwiki.org/wiki/Skins/{$DefaultName}]]

http://www.pmwiki.org/wiki/Skins/HomePage

Note how the internal links work

[[Skins]]

[[Skins/]]

Skins

Skins

both links link to Skins.Skins

This is caused by the default $PagePathFmt and was fixed for pmwiki.org with a line in .htaccess.

The problem is that this variable sets the priority not only for the current page, but also for links to other pages (in the core function MakePageName). So, every time when, among CurrentGroup.NAME (DefaultGroup.NAME), NAME.NAME and NAME.DefaultPage, at least two exist, we must define the priority to open or link to those pages. Default is to open/link to CurrentGroup.NAME if it exists (DefaultGroup.NAME if we don't know CurrentGroup), then NAME.NAME, then NAME.DefaultPage, if they exist. A link [[Skins]] from a page in the PmWiki group should link to PmWiki.Skins, and not Skins.Skins if both exist.

For the moment, we cannot split the processing of the current page url and the links to other pages, to use different $PagePathFmt settings. This MakePageName function is simply not designed this way. --Petko November 25, 2012, at 09:02 AM

Please consider as a Core candidate for PmWiki 3 simon January 12, 2013, at 03:44 PM