Page MenuHomePhabricator

Unable to insert a template using the template editor
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

I seem to be unable to use the template editor to insert or edit a template within a comment I am drafting using Flow.

Note: I have also been able to reproduce this issue in the main namespace at mediawiki.org.

Environment

Where the issue was observed.

  • Wiki: mediawiki.org
  • Browser: Chrome
  • Platform: Desktop

Behavior

  1. Visit a talk page where Flow / StructuredDiscussions is enabled. E.g. https://www.mediawiki.org/wiki/Talk:Talk_pages_project/Replying.
  2. Click any Reply link to initiate the process of drafting a comment
  3. Type {{ to open the Insert a template dialog
  4. With the Insert a template dialog open, type some letters to locate an existing template. E.g. tq.
  5. Click the Talk quotation result that appears within the search results
  6. Add some text to the Text field. In this case, I pasted in a sentence (all latin characters).
  7. Click Insert

Actual

  1. ❗️A dialog appears that says Close template editor? Changes will be lost and cannot be undone.

Expected

  1. ✅I'm returned to the comment I was drafting with the text I pasted in "Step 6." visible and styled

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
ppelberg updated the task description. (Show Details)
ppelberg updated the task description. (Show Details)
ppelberg added a subscriber: Whatamidoing-WMF.

May be caused by rEVEDa7ba729d8ce2: Refactor confirmation logic?

I think the default: label should instead be case '': (the action is an empty string when closing the dialog e.g. using the Escape key).

Or you need to handle more actions explicitly (e.g. when closing the dialog using the "Insert" button, or Ctrl+Enter, the action is 'done').

(I'll submit a patch with that change later, if WMDE folks aren't available to confirm.)

Change 757443 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/VisualEditor@master] Don't wrap unknown actions with confirmation

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

awight changed the subtype of this task from "Task" to "Bug Report".

May be caused by rEVEDa7ba729d8ce2: Refactor confirmation logic?

I think the default: label should instead be case '': (the action is an empty string when closing the dialog e.g. using the Escape key).

Or you need to handle more actions explicitly (e.g. when closing the dialog using the "Insert" button, or Ctrl+Enter, the action is 'done').

Thanks, I agree with this analysis. Only the close action should have displayed this confirmation dialog.

thiemowmde set the point value for this task to 1.
brennen raised the priority of this task from High to Unbreak Now!.Jan 26 2022, 2:24 PM

Change 757443 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Don't wrap unknown actions with confirmation

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

Change 757145 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Awight):

[mediawiki/extensions/VisualEditor@wmf/1.38.0-wmf.19] Don't wrap unknown actions with confirmation

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

Change 757145 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@wmf/1.38.0-wmf.19] Don't wrap unknown actions with confirmation

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

Mentioned in SAL (#wikimedia-operations) [2022-01-26T19:39:38Z] <lucaswerkmeister-wmde@deploy1002> Synchronized php-1.38.0-wmf.19/extensions/VisualEditor/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js: Backport: [[gerrit:757145|Don't wrap unknown actions with confirmation (T300095)]] (duration: 00m 51s)

awight claimed this task.

Seems to be fixed and deployed. Thanks for the bug report!