Item10167: Rename does not update backlinking INCLUDEs

Priority: Urgent
Current State: Closed
Released In: 1.1.3
Target Release: patch
Applies To: Engine
Reported By: AndreLichtsteiner
Waiting For:
Last Change By: KennethLavrsen
We observe a strange behaviour difference in Foswiki 1.1.2 to Foswiki 1.0

Foswiki seem to trips when updating backlinking INCLUDEs.

  • You have a TopicA
  • Topic A get included in TopicB with %INCLUDE{"TopicA"}%
  • now, you rename TopicA
    • Foswiki recognises that it has to update a backlink in TopicB and lists TopicB under 'Update links'
    • Foswiki even creates a new revision of TopicB but nothing changes in TopicB

Test in (Foswiki 1.0.9) and (Foswiki 1.1.2) confirm it. Works here, but fails on the new Foswiki.

-- AndreLichtsteiner - 16 Dec 2010

I've added some unit tests to trunk that verify this issue. There is a general issue with quoted references in macros INCLUDE is only one macro that will have this issue. Since a quoted "WikiWord" in normal text is not linking, it shouldn't be renamed. So this should only apply to macro parameters.

Should the renaming apply to any quoted "web.topic" or 'web.topic' within a %{ }% macro, or does it need to be sensitive to the actual parameter, such as the default parameter, and "topic= " parameters?

-- GeorgeClark - 27 Dec 2010

I suspect that to really do this right, we need a forEachMacro iterator of some sort that implements the stack based parser in Foswiki::_processMacros to correctly extract nested macros in correct order. needs to pull all the macros and replace the quoted web and topic references from within the macros.

-- GeorgeClark - 27 Dec 2010

I have a fix that covers the quoted TopicName case, but is too broad in that it also renames non-linking quoted names in plain TML that should not be renamed. The change to getReferenceRE - Create a custom Start/End WikiWord RE that also matches ".

    # SMELL: Item10176 -  Adding doublequote as a WikiWord delimiter.   This causes non-linking quoted
    # WikiWords in tml to be incorrectly renamed.   But does handle quoted topic names inside macro parameters.
    # But this doesn't really fully fix the issue - $quotWikiWord for example.  
    my $reSTARTWW = qr/^|(?<=[\s\("])/m;
    my $reENDWW   = qr/$|(?=[\s",.;:!?)])/m;

-- GeorgeClark - 04 Jan 2011
Topic revision: r13 - 16 Apr 2011, KennethLavrsen
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