You are here: Foswiki>Tasks Web>Item12284 (16 Aug 2015, GeorgeClark)Edit Attach

Item12284: Links to remote Images are not changed on renaming the Source Topic

pencil
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: minor
Applies To: Engine
Component: FoswikiRender, FoswikiUIRename, Backlinks
Branches:
Reported By: OliverSchaub
Waiting For:
Last Change By: GeorgeClark
Images placed with the %IMAGE% Tag referring to images on other Topics are not touched when the source Topic is renamed.

Href-Tags inside the Image-Tag ARE updated. It's just the link to the Image:

%IMAGE{"SourceTopic/some-image.png" href="SomeOtherTopic"}%

We use the latest Image-Plugin and are on Foswiki 1.1.5

-- OliverSchaub - 07 Dec 2012

We found out, that the finding backlink script works fine.
Before a topic is getting renamed, all the backlinks are listed. In this step ALL topics are found. (See below)
But when the topic is renamed, just the href-attribute is changed to the new topicname, the image-path is still the old one.
Conclusion: Finding backlinks and changing backlinks are different scripts!

Topic-list, where backlinks were found:
  • Href-TestTopic ==> %IMAGE{"OtherTopic/some-image.png" href="OldTopicName"}%
  • ImagePath-TestTopic ==> %IMAGE{"OldTopicName/some-image.png" href="OtherTopic"}%

After renaming:
  • Href-TestTopic ==> %IMAGE{"OtherTopic/some-image.png" href="NewTopicName"}%
  • ImagePath-TestTopic ==> %IMAGE{"OldTopicName/some-image.png" href="OtherTopic"}%

-- SimonRissi - 17 Dec 2012

Thanks for the details on this one. Unfortunately rename of backlinks is one of the more complicated areas to touch. The search is done in a way to be as fast as possible across possibly an extremely large number of topics. So it is rather generous in what it finds. The updates are done much more precisely in an attempt to only change occurrences that are links to the topic. The definition of "link" is rather limited because as you might imagine too aggressive renaming can result in as much damage as missing a reference.

It's probably the trailing slash after the topic name. The tests cover cases like INCLUDE{"OldTopicName"} and other variations. %IMAGE isn't a default macro, and is not covered in the rename test cases. The original definition of a "link" for rename purposes was exactly that - a WikiWord that is automatically linked. It's gradually been expanded. The code to find links is actually part of the Render module, and not part of Rename.

I'll set this to confirmed, but the particular area of code is rather fraught with challenges. Also downgrading this to Normal, so it doesn't block our next patch release, which we need for some security fixes. Targeted for 1.2.0 if we can make the change safely. Your detailed examples help quite a bit with that.

-- GeorgeClark - 18 Dec 2012

Deferring to 1.2.1.

-- GeorgeClark - 15 Mar 2015
 

ItemTemplate edit

Summary Links to remote Images are not changed on renaming the Source Topic
ReportedBy OliverSchaub
Codebase 1.1.6, 1.1.5, trunk
SVN Range
AppliesTo Engine
Component FoswikiRender, FoswikiUIRename, Backlinks
Priority Normal
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease minor
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r6 - 16 Aug 2015, GeorgeClark
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