Page MenuHomePhabricator

VisualEditor: Applying a link to an invalid title triggers an undo
Closed, ResolvedPublic

Description

  1. Type some text which is an invalid title in MW, e.g. "|InvalidTitle"
  2. Select it and hit link
  3. Notice that there are no suggestions, and no initial link is applied
  4. Type in a valid page name, e.g. "Main page" and press Done
  5. Notice some of your text has been deleted (by and undo operation) before the link was applied

The bug is actually in core AnnotationInspector#getTeardownProcess. We call a surface undo() to remove the initial annotation, but in the case of an invalid title there is no initial annotation.


Version: unspecified
Severity: normal

Details

Reference
bz70167

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:36 AM
bzimport set Reference to bz70167.

gerritadmin wrote:

Change 157053 had a related patch set uploaded by Esanders:
Only undo if an initial annotation was applied

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

gerritadmin wrote:

Change 157053 merged by jenkins-bot:
Only undo if an initial annotation was applied

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