DiscussionTools's reply tool doesn't work when the comments are transcluded from another page using a template (not directly).
Open questions
- 1. Are there adjustments projects can make to the templates they are using to achieve the same result while also being compatible with how the Reply Tool currently works?
Examples
Example 1: ko.wp featured article discussions
(originally reported here: https://ko.wikipedia.org/wiki/위키백과:사랑방_(기술)/2020년_7월#Reply_tool_as_a_Beta_Feature)
DiscussionTools doesn't work on featured article discussions on ko.wp, e.g. on this page: https://ko.wikipedia.org/wiki/위키백과:알찬_글_후보
Reply links appear, but the widget doesn't open, instead showing the error:
The "답변" link cannot be used to reply to this comment. To reply, please use the full page editor by clicking "원본 편집".
The reply links don't work because the subpages with discussions are transcluded using the template 알찬 글 토론 rather than directly (e.g. {{알찬 글 토론|로드 (가수)}} rather than {{위키백과:알찬 글 후보/로드 (가수)}}), in order to add the collapsible box around each discussion, so our tool isn't able to find the page where the comments are really written (and where the replies should be added).
We should investigate and see if we can add support for this case.
Ed: Example in English:
Template:Discussion
{{:Discus/{{{1}}}}}
Discus/Test
Hello world
Test
{{Discussion|Test}}
The final page Test outputs Hello world:
<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Discussion","href":"./Template:Discussion"},"params":{"1":{"wt":"Test"}},"i":0}}]}' id="mwAg">Hello world</p>
There is no mention of Discus/Test in the HTML output
HTML of the template page:
<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":":Discus/{{{1}}}","href":"./Discus/"},"params":{},"i":0}}]}' id="mwAg">{{:Discus/{{{1}}}}}</p>
DiscussionTools needs to recurse into each transclusion level, one by one, in order to identify the "real" page holding a given reply or topic, but currently this only works when the transclusion does not have parameters. Although Parsoid generates mw:Param markup for parameters out in free text, there is no mw:Param markup in the mw:Transclusion above, just unparsed wikitext {{{1}}}.
Example 2: pt.wp article merge discussions
Similar situation where a discussion page is transcluded using a template: https://pt.wikipedia.org/wiki/Discussão:Feudalismo
Example 3: en.wp The Signpost
Similar problem affects the comments sections of English Wikipedia's The Signpost, such as this one: https://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost/2021-06-27/Forum#comments (in this case the discussion is transcluded from the talk page: https://en.wikipedia.org/wiki/Wikipedia_talk:Wikipedia_Signpost/2021-06-27/Forum).