[[SomeFoo.SomeBar][SomeBar]] links to the SomeFoo.SomeBar.WebHome subweb even though there is a SomeBar topic in the SomeFoo web.
When hierarchical webs are enabled there is a feature (undocumented?)
that introduces a semantic clash for
SomeFoo.SomeBar
pointing either to the
subweb or the
topic called SomeBar.
I'd opt to remove the feature that
SomeFoo.SomeBar
can point to
SomeFoo.SomeBar.WebHome
as it is (a) buggy and (b) sucking performance
Test create a topic Sandbox in the Sandbox web with content:
[[Sandbox]]
- hierarchical webs enabled it links to Sandbox.WebHome ... wrong
- hierarchical webs disabled it links to Sandbox.Sandbox ... correct
[[Sandbox]] should point to the same location no matter if
you enabled hierarchical webs or not.
Patch:
--- Render.pm (revision 11513)
+++ Render.pm (working copy)
@@ -721,24 +721,11 @@
$topic = $link if( $link );
- if( $TWiki::cfg{EnableHierarchicalWebs} ) {
- # look up the leading path components to see
- # if they form a valid web path.
- my @topica = split( /\./, $topic );
- my @weba;
- while( @topica && $this->{session}->{store}->webExists(
- join('.', @weba, $topica[0]))) {
- push(@weba, shift(@topica));
- }
-
- $web = join('.', @weba) if scalar(@weba);
- $topic = join('', @topica);
- } else {
- if( $topic =~ s/^($TWiki::regex{webNameBaseRegex}|$TWiki::regex{defaultWebNameRegex})\.//) {
- $web = $1;
- }
- $topic =~ s/\.//g;
+ if( $topic =~ s/^($TWiki::regex{webNameBaseRegex}|$TWiki::regex{defaultWebNameRegex})\.//) {
+ $web = $1;
}
# Topic defaults to the current topic
($web, $topic) = $this->{session}->normalizeWebTopicName( $web, $topic );
--
MD
Please be very careful, do not change the current spec for top level webs. In particular, these rules apply:
You type |
Label shown |
Comment |
Someweb.SomeTopic |
SomeTopic |
|
Someweb.WebHome |
• WebHome (if in Someweb web) • Someweb (if in other web) |
Special case if in other web, so that users can type: For support visit the Support.WebHome web to get this: For support visit the Support web |
We can't change this spec or we would break existing content.
Nevertheless, the spec has not been defined for sub-webs.
--
PTh
Duplicate of
Item2841. See that item for further discussion.
CC