Skip Menu |

This queue is for tickets about the Kwiki-BreadCrumbs CPAN distribution.

Report information
The Basics
Id: 16483
Status: open
Worked: 2 hours (120 min)
Priority: 0/
Queue: Kwiki-BreadCrumbs

People
Owner: Nobody in particular
Requestors: william [...] knowmad.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.12
Fixed in: (no value)



Subject: Breadcrumbs for sub-wikis being included in parent
We have two wikis setup on our server--one for general use and one that is password protected. The password protected wiki is running inside a subdirectory of the general wiki. I am seeing entries for pages on the protected showing up in the breadcrumb list when browsing the general wiki. The links are broken since the page only exists on the sub-wiki. Thanks, William
On Wed Dec 14 10:50:50 2005, guest wrote: Show quoted text
> We have two wikis setup on our server--one for general use and one > that is password protected. The password protected wiki is running > inside a subdirectory of the general wiki. I am seeing entries for > pages on the protected showing up in the breadcrumb list when > browsing the general wiki. The links are broken since the page only > exists on the sub-wiki. > > > Thanks, > William
Me too! only my second one wasn't a subdir of the first. Anyway the attached patch should fix your situation too. David Nicol
--- BreadCrumbsold.pm 2006-03-15 16:16:47.000000000 -0600 +++ /usr/pkg/lib/perl5/site_perl/5.8.0/Kwiki/BreadCrumbs.pm 2006-03-15 16:56:00.000000000 -0600 @@ -11,9 +11,9 @@ return unless $self->is_in_cgi; super; my $bread_crumbs = $self->hub->cookie->jar->{bread_crumbs} || []; if ($self->hub->action eq 'display') { - my $page_id = $self->pages->current->id; + my $page_id = join(':',$ENV{SCRIPT_NAME},$self->pages->current->id); @$bread_crumbs = grep { $_ ne $page_id } @$bread_crumbs; unshift @$bread_crumbs, $page_id; } splice @$bread_crumbs, 10 @@ -51,17 +51,29 @@ my @trail = @{$self->trail}; my $show = $self->preferences->show_bread_crumbs->value; splice @trail, $show if @trail > $show; - my $script_name = $self->config->script_name; my $pages = $self->hub->pages; + my $script_name0 = $ENV{SCRIPT_NAME}; "<hr />" . join ' &lt; ', map { - my $page = $pages->new_page($_); + my $script_name = $script_name0; + my $page_id = $_; + my $page = $pages->new_page($page_id); + my $uri = $page->uri; + my $title = $uri; + if ($uri =~ m/([^:]+):(.+)/){ # for bumpless upgrade from older BreadCrumbs + ($script_name,$uri) = ($1,$2); + if($script_name ne $script_name0){ + $title = "$uri at $script_name"; + }else{ + $title = $uri; + }; + }; sprintf "<a href=\"%s?%s\">%s</a>\n", $script_name, - $page->uri, - $page->title; + $uri, + $title; } @trail; } __DATA__