Page MenuHomePhabricator

VisualEditor: JavaScript crashes if an invalid keyword is used on an image
Closed, ResolvedPublic

Description

To reproduce, go to the URL ([[User:Amire80/ve-invalid-image-keyword]]). Notice that the save button doesn't appear in the toolbar. The JS console shows the following error:

[15:59:08.469] Error: Offset could not be translated to a DOM element and offset: 3

The reason for this is the invalid keyword "no_such_keyword" that I used on the image.

A better behavior would be to show the user some kind of a warning about the wrong keyword, rather than throwing a JS error and crashing.

This bug was discovered by User:Nurick in the Hebrew Wikipedia.


Version: unspecified
Severity: normal
URL: https://en.wikipedia.org/wiki/User:Amire80/ve-invalid-image-keyword?veaction=edit

Details

Reference
bz54903

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:35 AM
bzimport set Reference to bz54903.

This seems to have occurred because we tried to put the selection inside the image caption, which then caused an error. For whatever reason, this doesn't seem to be happening any more; opening your test page in VE doesn't reproduce the error now.