Page MenuHomePhabricator

Create special page for finding redirects to fragments/sections that don't exist
Open, LowPublicFeature

Description

Feature summary:

There should be a special page at [[Special:BrokenSectionRedirects]] to list section redirects whose target heading doesn't exist. These can happen when a section in the target page is deleted, renamed, etc (there are 1-2 other ways to break it too).

Benefits:

Would allow the detection (and fixing) of broken section redirects.

Notes:

With redirect.rd_fragment now implemented, [what does this mean?] it should be possible to list redirects where the target contains a broken section anchor. For example, if the redirect page "Baz" contains "#REDIRECT [[Foo#Bar]]" and the "Bar" section no longer exists on the page "Foo", "Baz" would be listed somewhere in the user interface.

Note that section headers on special pages function a bit differently, so it's important that they don't generate false positives. It'd be even better if section redirects to special pages were checked for errors as well -- this methodology might be a little different, though.

See also T395298: Throw error message on attempt to create "Broken section redirect" to section that doesn't exist on page that does exist.

Details

Reference
bz28813

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:33 PM
bzimport set Reference to bz28813.
bzimport added a subscriber: Unknown Object (MLST).

There's still no guarantee that the target anchor of the redirect is pointing to a section as opposed to a hand made <div id="blah"> thing. However, ignoring that we also don't store what sections actually exist on a page (as far as I'm aware) in the db. So there's still a fair bit more to do before that can happen.

Krinkle renamed this task from User interface to list broken redirect section anchors to Create special page for finding redirects to fragments/sections that don't exist.Jul 31 2017, 9:31 PM
Krinkle updated the task description. (Show Details)
Krinkle moved this task from General to General on the MediaWiki-Redirects board.
Krinkle removed a subscriber: wikibugs-l-list.

Another idea is to use the Linter extension and its framework to add a tracking category to redirect pages that have invalid/broken section anchors. This would require getting the Linter extension to work with a non-Parsoid "external service" and would require solving the challenges @Bawolff mentions about manually added IDs.

After the redirect target page is touched and we have the rendered HTML, we could look for all IDs, whether manually added or via a section link, then look up section redirects, and then record the missing ones as lint errors (or somewhere). And then we'd have to do the same whenever the redirect page itself is edited and contains a fragment.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:00 AM
Bugreporter2 awarded a token.
Bugreporter2 updated the task description. (Show Details)