Item10259: Renaming web may incorrectly modify links within topic starting with old web name
Priority: Urgent
Current State: Closed
Released In: 1.1.3
Target Release: patch
Applies To: Engine
Component: rename web
Branches:
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
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