[pmwiki-users] Renaming a document

John Rankin john.rankin at affinity.co.nz
Tue Aug 2 18:58:57 CDT 2005


On Wednesday, 3 August 2005 11:07 AM, Hans <design at flutesong.fsnet.co.uk> wrote:
>Wednesday, August 3, 2005, 12:00:01 AM, John wrote:
>> It uses redirect rather than searching out all references 
>> to the renamed page and changing them because this may
>> inadvertently change the sense of what had been written.
>
>it may, but on many occasions the changing of all references may be
>more desirable. Perhaps there could be a choice of doing it via
>redirect or via changing of link references?
>
>
>Best, 
>~Hans                           
>
Yes, that would be very nice!

It might not be that easy -- I don't know enough about the
pmwiki internals. Specifically, the backlinks search appears to
reply on a $page['targets'] attribute, containing the names of
all the links on a page. So I think the kind of capability you 
describe means being able to find the actual references in the
body of the text /and/ update the attribute value.

Such a recipe could be quite dangerous, as it could corrupt
a page, or work now, but corrupt the page if pmwiki changes
its internals.

The general text replacement also raises questions.

What, for example, should it do with a reference like this:

 [[Imag(es)]]ing

Somehow, just replacing the entire thing with [[New Name]]
seems not the right thing to do.

>From a risk management point of view: if we get this wrong,
it could corrupt an entire site. So, we might want to
present each page one at a time through an edit preview and
ask the user to confirm that the change can be posted.
This would also allow pmwiki to take care of updating the 
'targets' attribute, so is one less thing to go wrong.

Maybe a more general solution would be a 'search and replace'
recipe. Why restrict this to links?

At the moment, I'm not sure of the answers to these and
other questions, so would rather do nothing until we
have a solution that's going to be robust.

In other words: I'd need help to provide such a capability!
-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list