The use of $dummy was not sufficient, because it only stuck around for the
first element after a dummy parent, and was then lost. Instead, use a
$addparent that contains the actual dummy parent, so it can be compared
with the new item to see if we're still under that parent or have moved to
another one.
(cherry picked from commit
9b10f5eab22be36cf3b3a217076c76a669b4aafa)
my $parent="";
my $indent=0;
my $openli=0;
my $parent="";
my $indent=0;
my $openli=0;
my $map = "<div class='map'>\n<ul>\n";
foreach my $item (sort keys %mapitems) {
my @linktext = (length $mapitems{$item} ? (linktext => $mapitems{$item}) : ());
my $map = "<div class='map'>\n<ul>\n";
foreach my $item (sort keys %mapitems) {
my @linktext = (length $mapitems{$item} ? (linktext => $mapitems{$item}) : ());
my $baseitem=IkiWiki::dirname($item);
while (length $parent && length $baseitem && $baseitem !~ /^\Q$parent\E(\/|$)/) {
$parent=IkiWiki::dirname($parent);
my $baseitem=IkiWiki::dirname($item);
while (length $parent && length $baseitem && $baseitem !~ /^\Q$parent\E(\/|$)/) {
$parent=IkiWiki::dirname($parent);
- last if !$dummy && length $parent && $baseitem =~ /^\Q$parent\E(\/|$)/;
+ last if length $addparent && $baseitem =~ /^\Q$addparent\E(\/|$)/;
+ $addparent="";
$indent--;
$map .= "</li>\n";
if ($indent > 0) {
$map .= "</ul>\n";
}
}
$indent--;
$map .= "</li>\n";
if ($indent > 0) {
$map .= "</ul>\n";
}
}
while ($depth < $indent) {
$indent--;
$map .= "</li>\n";
while ($depth < $indent) {
$indent--;
$map .= "</li>\n";
$map .= "<ul>\n";
}
if ($depth > $indent) {
$map .= "<ul>\n";
}
if ($depth > $indent) {
+ $addparent=$p;
+ $addparent=~s/^\///;
$map .= "<li>"
.htmllink($params{page}, $params{destpage},
$map .= "<li>"
.htmllink($params{page}, $params{destpage},
- $p, class => "mapparent",
+ "/".$common_prefix.$p, class => "mapparent",
noimageinline => 1)
."\n";
$openli=1;
noimageinline => 1)
."\n";
$openli=1;
* inline: Ignore parent dirs when sorting pages by title.
* external: Fix support for hooks called in an array context.
* edittemplate: Don't wipe out edits on preview.
* inline: Ignore parent dirs when sorting pages by title.
* external: Fix support for hooks called in an array context.
* edittemplate: Don't wipe out edits on preview.
+ * map: The fix for #449285 was buggy and broke display of parents in certian
+ circumstances.
-- Josh Triplett <josh@freedesktop.org> Wed, 09 Jul 2008 21:30:33 -0700
-- Josh Triplett <josh@freedesktop.org> Wed, 09 Jul 2008 21:30:33 -0700