Foswiki on GitHub is open for business! Next release meeting: Monday September 1, 1300Z

Item10259: Renaming web may incorrectly modify links within topic starting with old web name

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Closed Engine rename web  
The example:

  • I had a web named EdNet and I used the WebPreferences web rename link to rename it to Edu
  • Within the web I had topic pages that had links in the form of EdNetSomeTopicName and EdNetSomeOtherTopic
  • The links in the topic pages containing them were changed to EduSomeTopicName and EduSomeOtherTopic
  • The actual topics were not renamed, so the links broke.

So it seems that the code that combs through topics to find links with the web specified in the link is not looking for the period after the web name. So in this example it seems that it should have been trying to match and fix links that matched (using psuedo regex for the situation) ^EdNet\..* but instead was matching all links with ^EdNet.* ignoring the fact that the leading EdNet was not actually specifying a WEB name.

The web wasn't too big, so I was able to find and fix the links for my users, so I'll mark this as Normal priority. I bet folks don't rename webs all that often. I think the bug might have been around for quite a while, because it seems to be jogging a faint and distant memory.

-- KiltBear - 14 Jan 2011

This breaks our user's data. Raised to urgent.

-- PaulHarvey - 14 Jan 2011

Confirmed - this is indeed broken. Added a unit test to show the issue.

-- GeorgeClark - 15 Jan 2011

Also noted that a Web containing the renamed web is incorrectly renamed. EdNetTwo.SomeTopic becomes EduTwo.SomeTopic

-- GeorgeClark - 15 Jan 2011

I think I've fixed this - committed additional unit tests and fix to both trunk and release 1.1. Leaving open because this needs some more review to see if there are other cases that should or should not be handled. Also, need to check out quoted references.

-- GeorgeClark - 15 Jan 2011

Quoted references worked okay. Added to unit test.

-- GeorgeClark - 15 Jan 2011

Excellent work George smile Looks good and seems to work. Set WaitingFor Kilt, could you try replacing your lib/Foswiki/Render.pm with this one?

-- PaulHarvey - 15 Jan 2011

Added a unit test to verify that the same topic / web references are updated when renaming a subweb. changing to waiting for release.

-- GeorgeClark - 19 Jan 2011
 

ItemTemplate edit

Summary Renaming web may incorrectly modify links within topic starting with old web name
ReportedBy KiltBear
Codebase 1.1.2, 1.1.1, 1.1.0, 1.1.0 beta1, trunk
SVN Range
AppliesTo Engine
Component rename web
Priority Urgent
CurrentState Closed
WaitingFor
Checkins Foswikirev:10543 Foswikirev:10546 Foswikirev:10547 Foswikirev:10548 Foswikirev:10551 Foswikirev:10552 Foswikirev:10553 Foswikirev:10554 Foswikirev:10566 Foswikirev:10567
TargetRelease patch
ReleasedIn 1.1.3
Topic revision: r22 - 16 Apr 2011, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License