Update backlinks when a page is renamed#530
Conversation
|
thanks to @skirmess for their initial work creating a plugin, which formed the basis of implementing this PR into otter wiki core code. |
redimp
left a comment
There was a problem hiding this comment.
Wow, thats a big one. Thanks for the work @ribbal (and @skirmess for the plugin).
Some notes from the first glance:
(1) This should not be enabled by default. This is a behavior change that admins have to be aware of.
(2) Users should be able to pick if they want to update backlinks, please add a checkbox that has to be enabled in the rename form.
(3) This needs tests. Make sure to cover various cases. I stumbled over a bug on first try:
Pages with spaces (or other URL-encoded characters) in the name break Markdown-link rewriting both ways. [x](/Old%20Page) yields yields get_filename("Old%20Page") == "old%20page.md"
|
@redimp, I've addressed the points that you raised:
|
This change updates the following 'backlinks' when a page is renamed:
The functionality is controlled by a new UPDATE_LINKS_ON_RENAME config setting (default on)The functionality is controlled by a new Update backlinks checkbox on the Rename page (default off) - it retains the users last setting during the current browser session.
The following plugin hooks are implemented:
repository_changed- uses the existing hook, but includes all the pages where backlinks were updatedpage_saved- for each of the pages where backlinks were updatedFixes: a) and b) on #228.