Skip to content

Update backlinks when a page is renamed#530

Open
ribbal wants to merge 10 commits into
redimp:mainfrom
ribbal:feature/rename-backlinks
Open

Update backlinks when a page is renamed#530
ribbal wants to merge 10 commits into
redimp:mainfrom
ribbal:feature/rename-backlinks

Conversation

@ribbal

@ribbal ribbal commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This change updates the following 'backlinks' when a page is renamed:

  • WikiLinks
  • Markdown links
  • links to attachments on the renamed page

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 updated
  • page_saved - for each of the pages where backlinks were updated

Fixes: a) and b) on #228.

@ribbal

ribbal commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

thanks to @skirmess for their initial work creating a plugin, which formed the basis of implementing this PR into otter wiki core code.

@redimp redimp left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

@ribbal

ribbal commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@redimp, I've addressed the points that you raised:

  1. The new checkbox (see point 2 below) is unchecked by default

  2. Added a new checkbox to the Rename page. It is initially unchecked by default, and thereafter defaults to the user's most recent selection during the current browser session

  3. Added tests to cover the new behaviour

@ribbal
ribbal requested a review from redimp July 20, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants