You are here: Foswiki>Tasks Web>Item771 (22 Feb 2009, OlivierRaginel)Edit Attach

Item771: # anchors link to the included topics' web . WebHome when included from another topic

pencil
Priority: Urgent
Current State: Closed
Released In:
Target Release: patch
Applies To: Engine
Component:
Branches:
Reported By: SvenDowideit
Waiting For:
Last Change By: OlivierRaginel
while looking into Item750 i've found a further oddity if you INCLUDE{System.Macros}

MMMMM. # anchors are broken when done inside Includes - eg??

INCLUDE{Sandbox.IncludedTopicWithAnchorsAndLinks}
No permission to view IncludedTopicWithAnchorsAndLinks
the Anchor above is being directed to Sandbox WebHome #Anchor - not as one would expect, the # Anchor in this topic, or possible brokenly to the # Anchor in IncludedTopicWithAnchorsAndLinks

I think for now that means we'll have to cripple the [[VarY][Y]] by replacing the INCLUDINGTOPIC with BASETOPIC - so it works on System.Macro's but isn't totally broken if someone INCLUDE{System.Macro}'s frown, sad smile

-- SvenDowideit - 15 Jan 2009

The real situation is that the #MyAnchor links in an included topic works if the included topic is in the same web as the including topic.

But if the included topic is in another web the anchor link is a link to WebHome

That is a clean cut bug that should be fixed.

-- KennethLavrsen - 07 Feb 2009

ah, excellent, thanks for pointing that out, we may well be able to just make a unit test for it and thus fix it wink

-- SvenDowideit - 08 Feb 2009

It looks a bit similar in effet to TWikibug:Item2209

The fix was TWikirev:10061. But it won't help us here frown, sad smile

Pinpointed to _fixupIncludedTopic in Foswiki.pm.

Fixed by distro:4bf9f0e74929. It would be really nice to write a unit test checking this, but unit test with full formatting are still off target for me. Sven, if you have a minute... smile

-- OlivierRaginel - 21 Feb 2009

I think you misunderstood how this feature is supposed to work.

When I have a topic with a relative Anchor link like [[#SomeAnchor][My anchor]] and I include this topic in a parent topic, I expect the relative link to point to the place of the anchor within the topic I view.

The fix you made makes the relative anchor link absolute and clicking it makes you end up in the included topic instead of the topic you are viewing.

Release blocker

-- KennethLavrsen - 22 Feb 2009

Right. Sorry, my bad. Your view makes much more sense.

Fixed the code (one line change in fact), and added 2 unit tests (with anchor as #anchor, and as #WikiName).

Therefore, closing it.

-- OlivierRaginel - 22 Feb 2009

ItemTemplate edit

Summary # anchors link to the included topics' web . WebHome when included from another topic
ReportedBy SvenDowideit
Codebase 1.0.0, trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:4bf9f0e74929 distro:9cfdc6b46f86 distro:d52ebecf08f5 distro:a3104f8dbfa5 distro:8bb8d6313125
TargetRelease patch
ReleasedIn
I Attachment Action Size Date Who Comment
replaceINCLUDING.patchpatch replaceINCLUDING.patch manage 121 K 05 Feb 2009 - 02:45 SvenDowideit patch to work around anchor bug :/
Topic revision: r13 - 22 Feb 2009, OlivierRaginel
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy