Page MenuHomePhabricator

"Insert link" dialog: Empty title alert only shows key of message when pressing Enter
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

When using the "Insert link" dialog, if I don't enter a title and press the Enter key, I get an alert saying:

⧼wikieditor-toolbar-tool-link-empty⧽

This is the key of the message, rather than the message itself.

The message itself will depend on the user's interface language. If the user's interface language is English, the alert should say:

You did not enter anything to link to.
Steps to reproduce problem
  1. Go to any page on a wiki (e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Special:Random)
  2. Open the WikiEditor
  3. Click the "Insert link" menu item (tooltip: "Link")
  4. Press the Enter key

Expected behavior: The alert says: You did not enter anything to link to (if you are testing in English, otherwise translated into your interface language)
Observed behavior: The alert says: ⧼wikieditor-toolbar-tool-link-empty⧽

Environment

Browser: Firefox and Chrome (did not test IE, Edge or Safari)
Wiki(s): https://test.wikipedia.org MediaWiki 1.38.0-wmf.16 (rMWdc3e3a80f955) 12:29, 4 January 2022, WikiEditor 0.5.3 (2e5791c) 08:31, 27 December 2021.
Editor, if applicable: WikiEditor

Screenshots

alert.png (423×573 px, 28 KB)

Event Timeline

Change 752597 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/WikiEditor@master] Properly disable insert-link button

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

Samwilson subscribed.

This alert should not actually exist at all any more. Rather than fixing the message, we need to remove the whole thing because it should never be possible to click 'Insert link' when the target is empty.

Change 752597 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Properly disable insert-link button

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

@Samwilson I am finding that when I open the "Insert link" dialog and press enter, it inserts an empty link ([[]]). Both on beta and my local docker.

Change 761867 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/WikiEditor@master] Check for disabled button in click handler

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

Thanks for finding this @dom_walden. There was me thinking that a disabled button would be protected against being clicked, but no!

Change 761873 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/WikiEditor@master] Remove out of date invalid link alert

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

Change 761873 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Remove out of date invalid link alert

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

Change 761867 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Check for disabled button in click handler

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

I have not been able to reproduce the original bug, i.e. I cannot find a way to submit the "Insert link" dialog when the first input field is empty (with the exception of this circumstance T298549).

The "Insert link" dialog has a lot of state behaviour (see state diagram). So, I tried to reproduce the bug after one or more of these states has been triggered, especially in a long sequence as I know this can cause other bugs (e.g. T297371, T298549):

  • Tested entering several different types of links in a row and then trying to repro
  • Tried to repro with the dialog in various "saved" states
  • Tried to repro after looping between various states

I got distracted investigating and reporting unrelated bugs in the "Insert link" dialog, so I wasn't as focused as I could have been.

Moreover, there are lots of states in which the "Insert link" dialog behaves a bit weirdly. No doubt there are some states I have missed. There could be bugs in this area I have not caught yet.

NRodriguez subscribed.

@dom_walden thanks for investigating related bugs. Going to resolve this ticket and we can triage whether the bugs you unveiled were pre-existing or already existed