[go: up one dir, main page]

Page MenuHomePhabricator

Error message without parameter appears when trying to reply to transcluded comment on a protected page
Closed, ResolvedPublicBUG REPORT

Description

Steps to reproduce

  1. Open https://hu.wikipedia.org/wiki/Wikip%C3%A9dia:T%C3%B6rl%C3%A9sre_javasolt_lapok?uselang=en while logged out.
  2. Click on any [reply] link.

Actual result

  1. A popup appears with the error message The "reply" link cannot be used to reply to this comment. To reply, please use the full page editor by clicking "".

Expected result

  1. A popup appears with an error message explaining that the Reply Tool cannot be used to reply to this comment, and the page the user is looking at right now is protected, but they may be able to edit the page the comment is stored on (in this case they can, e.g. Wikipédia:Törlésre javasolt lapok/Prókai Éva divattervező is not protected). (What I actually expect is that I can use the Reply Tool on this page, but that’s another thing…)

Event Timeline

No text passed to $1 in (discussiontools-error-comment-is-transcluded), which is defined as "the text of the 'Edit'/'Edit source' tab". Seems related to T301203.

I don’t think it’s related. First, I discovered this bug months ago, I just haven’t got around reporting it. Second, if the code used a non-existent message (I think you mean that by related), the result wasn’t empty, but would appear like ⧼foo⧽. The JavaScript code seems to simply not provide the parameter.

Actual result

  1. A popup appears with the error message The "reply" link cannot be used to reply to this comment. To reply, please use the full page editor by clicking "".

This happens because that message is supposed to refer to the "Edit" tab, which we implemented by fetching its text from the page itself (using $( '#ca-edit' ).text()), because it may differ depending on the skin and user's editor preferences. But this page is protected, so the tab doesn't exist.

We could instead display the message that normally appears on protected pages. You can see it in action e.g. on https://hu.wikipedia.org/wiki/Vita:Pilvax?uselang=en while logged out:

image.png (2×3 px, 398 KB)

Expected result

  1. A popup appears with an error message explaining that the Reply Tool cannot be used to reply to this comment, and the page the user is looking at right now is protected, but they may be able to edit the page the comment is stored on (in this case they can, e.g. Wikipédia:Törlésre javasolt lapok/Prókai Éva divattervező is not protected). (What I actually expect is that I can use the Reply Tool on this page, but that’s another thing…)

The problem here is that the reply tool can't figure out which page the comment is stored on, that's why it's asking the user to use the full page editor and figure it out themselves. You're running into this problem: T259824: DiscussionTools's reply tool doesn't work when the comments are transcluded from another page using a template (not directly)

Usually, when you're looking at a protected page that has comments transcluded directly from unprotected pages, you can in fact just use the reply tool there. Example: https://pl.wikipedia.org/wiki/Wikipedia:Poczekalnia/Zgłoszenia

Next step
To improve this experience in the short-term, we're going to adjust the error message that people who are logged out see so that it equips them with the information they need to respond to the comment they clicked a [ reply ] link with the intention of responding to:

Screen Shot 2022-03-10 at 8.28.21 AM.png (412×1 px, 67 KB)

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

[mediawiki/extensions/DiscussionTools@master] Fix error message when trying to reply to transcluded comment on a protected page

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

Change 791471 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Fix error message when trying to reply to transcluded comment on a protected page

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

For a logged in user:

Screenshot 2022-05-31 at 17.38.41.png (508×1 px, 79 KB)

For context: The logged in user had an empty string "" instead of "Edit source" before fix.

For a logged out user:

Screenshot 2022-05-31 at 17.39.07.png (510×1 px, 102 KB)