Page MenuHomePhabricator

Reply tool can't be used for comments that start with {{od}}{{re|…}} etc. ("The "reply" link cannot be used to reply to this comment")
Closed, ResolvedPublic

Description

Reply tool can't be used for comments that start with {{od}}{{re|…}} and similar markup. The error message is "The "reply" link cannot be used to reply to this comment". (Originally reported at T312828#8076979 by @Novem_Linguae)

image.png (287×1 px, 25 KB)

For example, the last comment at https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:New_pages_patrol/Coordination&oldid=1098068027 is like this:

{{od}}{{re|MB|Novem Linguae}} ... 02:00, 14 July 2022 (UTC)

Which results in Parsoid rendering like this: https://en.wikipedia.org/api/rest_v1/page/html/Wikipedia_talk%3ANew_pages_patrol%2FCoordination/1098068027 (prettified below)

<div class="outdent-template" style="position:relative;left:1px;" about="#mwt44" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"od","href":"./Template:Od"},"params":{},"i":0}}]}' id="mwAUM">
	<span style="display:block;width:16em;height:0.5em;border-bottom:1px solid #a2a9b1;border-right:1px solid #a2a9b1;"></span>
	<span style="display:block;width:16em;height:0.5em;border-left:1px solid #a2a9b1;"></span>
</div>
<p about="#mwt45" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"re","href":"./Template:Re"},"params":{"1":{"wt":"MB"},"2":{"wt":"Novem Linguae"}},"i":0}}," ..."]}' id="mwAUQ">
	<span class="template-ping">@<a rel="mw:WikiLink" href="./User:MB" title="User:MB">MB</a> and <a rel="mw:WikiLink" href="./User:Novem_Linguae" title="User:Novem Linguae">Novem Linguae</a>:</span> ...
</p>

What happens here:

  • In Parsoid:
    • The {{od}} template markup is placed outside of a paragraph, because it's a <div>
    • Therefore the markup following it has to generate the opening paragraph tag
    • Because this markup is a template, the opening paragraph tag is considered to be generated by a template
    • This forces the whole paragraph to be considered to be generated by a template
    • We now have a multi-part transclusion, consisting of the {{re}} template and the wikitext following it

(You can see that this happens easily by opening the page in visual editor – https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:New_pages_patrol/Coordination&oldid=1098068027&veaction=edit – and highlighting the transclusion:)

image.png (2×3 px, 437 KB)
image.png (2×3 px, 378 KB)

It's likely that this behavior could be changed – in a similar scenario where the transclusion is just a single template, we make the reply tool reply on the same page, because usually it's just some wrapper template (example). It'd be good to find some more examples where the current behavior does or doesn't work.

Event Timeline

It'd be good to find some more examples where the current behavior does or doesn't work.

Well, the task I just merged is a second example.

Change 840330 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Add test cases for T313093

https://gerrit.wikimedia.org/r/840330

Change 840331 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Allow replying to some comments with accidental complex transclusions

https://gerrit.wikimedia.org/r/840331

Change 840330 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Add test cases for T313093

https://gerrit.wikimedia.org/r/840330

Change 840331 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Allow replying to some comments with accidental complex transclusions

https://gerrit.wikimedia.org/r/840331

EAkinloose subscribed.

✅ Reply tool can't be used for template comments

Screenshot 2022-11-28 at 18.41.50.png (578×1 px, 87 KB)

Screenshot 2022-11-28 at 18.42.40.png (512×2 px, 187 KB)