|
Main sidebar
|
PITS /
00633Summary: Categories are incorrectly group qualified in pagelists of trails (or filtered out entirely)
Created: 2006-01-04 13:20
Status: Open - (was: Closed - fixed in 2.1.beta21)
Category: Bug
From: Martin Fick
Assigned:
Priority: 43
Version: 2.0
OS: Debian Linux (unstable)/Apache 2.0.55/PHP 5.0.5
Description:When using a category in a trail such as: page: MyGroup.FooTrail * [[Foo.Bar]] * [[Foo.MiliBar]] * [[!Silly]] ... and trying to do a paglist on it using:
(:pagelist trail=MyGroup.FooTrail:)
the category ends up getting listed as a page in the MyGroup group, as MyGroup.Silly. Analysis:There are two problems and they both occur in the trails.php ReadTrails() function here: if (!preg_match("/^([#*:]+) \\s*
(\\[\\[([^:#!|][^|:]*?)(\\|.*?)?\\]\\]($SuffixPattern)
| (($GroupPattern([\\/.]))?$WikiWordPattern)) (.*)/x",$x,$match))
continue;
if (@$match[6]) {
if (!$LinkWikiWords) continue;
$tgt = MakePageName($trailname,$match[6]);
} else $tgt = MakePageName($trailname,$match[3]);
Proposed Fix:
$match[3] = preg_replace("|^\!|", "$CategoryGroup.", $match[3]);
right before the line:
if (@$match[6]) {
With this patch, $match[3] will end up like Category.Silly, MakePageName() handles that properly.
A Test for this, at the bottom, the TestCategory is not even available as the next link as it should be. In the example above this will work it the correct syntax is used * [[Foo.Bar]] * [[Foo.MiliBar]] * [[Category/Silly]]See also PITS:00447 simon December 06, 2009, at 01:52 PM
|