Using the DT permalinks metadata database, we should be able to look up the plain section link in the full history of the page (which is contained within DT IDs).
Once we have a DT ID, we can do our normal search to find where the topic currently resides on the wiki. No need to configure what an archive page path looks like on a per-wiki basis.
- **As someone** who is wanting to view a topic that A) no longer exists on the page from which the link was generated and B) does NOT use the URL schema DiscussionTools introduced (T302012), **I want** to know that the software cannot locate the topic I am seeking, why it cannot locate said comment, and where I might look to find said comment, **so that** I can increase the chances that I can find the topic I'm seeking myself.
=== Open questions
- [ ] 1. What – if anything – should people experience who have one of the two gadgets below enabled? //E.g. will the code this ticket implements "listen for" the presence of these gadgets and disable itself when it detects them, as we did for the Reply Tool in T298909?//
There are two gadgets that implement this behaviour already, with nearly identical mechanisms (possibly one copied the other?):
* find-archived-section on en.wiki
* ConvenientDiscussions on ru.wiki and others
Both gadgets use the search API with srprop=sectiontitle and a pre-defined per-wiki prefix, e.g. "Page name/Archive...". CD switched to using mw.notify notifications instead of a banner to display the results.
When multiple results are found, the most recent one is displayed. In all cases (0/1/many results) a search link is provided, although this requires knowing about the archive prefix, so we would omit this from our implementation.
|CD | find-archived-section
T304579 will make it possible for people to locate a comment that has since been moved from the page on which the link to said comment was generated.
This task involves the work of extending the same capability to links that include a discussion topic's title, represented in the form of a hash [i] as opposed to the URL schema Discussion Tools introduced in T302012.