Page MenuHomePhabricator

Link dialog inserts wrong target page
Closed, ResolvedPublic

Description

The link dialog inserts a wrong page as a target page in some cases.
Steps to reproduce:

  1. Select a word and click the link icon.
  2. Press down key to select a target page from the suggestions. (It is important to use the keyboard only.)
  3. Press enter.

The link is inserted correctly.

  1. Select another word and click the link icon.

The selected word is displayed both as target and as text.

  1. Press enter.

Expected result: The selected word should just be wrapped in brackets.
Actual result: A link the page from step 2 as target and the displayed text form step 4 is inserted.


Version: unspecified
Severity: normal
URL: http://de.wikipedia.org/wiki/Wikipedia:Fragen_zur_Wikipedia#Linkerstellungswerkzeug

Details

Reference
bz27254

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:19 PM
bzimport added a project: WikiEditor.
bzimport set Reference to bz27254.
bzimport added a subscriber: Unknown Object (MLST).

I can confirm this on trunk r82002

Ok, it looks like the set of suggestions don't get reset properly when the dialog reinitializes itself on the second run.

(The dialog isn't destroyed on first completion; it's merely hidden, then re-shown and given new field contents.)

In the dialog's open function, it's calling:

$( '#wikieditor-toolbar-link-int-target' ).suggestions();

(the actual full setup came earlier, in the init function, and adds the handlers and such).

But in jquery.suggestions.js, it looks like the suggestions container and such don't get cleared here -- they only get created the first time round, then the data is saved, and it isn't recreated.

I can call .suggestions('suggestions', []) to clear the set, but this seems to break the initial load of data.

As I'm not sure where to proceed from here, I'm handing the bug over to Trevor, who seems to have his hands on jquery.suggestions.js :)

shealen.clare wrote:

This bug has not been touched in at least six months. With this in mind, I've been asked by the bugmeister to bump this bug's priority down from "High". Concerns can be addressed to mah@everybody.org.

Trevor:
This report has been in ASSIGNED status for more than one year and you are set as its assignee. In case that you are not actively working on a fix, please reset the bug status to NEW/UNCONFIRMED.
In case you do not plan to work on a fix in the near future: Please also edit the "Assigned To" field by clicking "Reset Assignee to default", in order to not prevent potential contributors from working on a fix. Thanks for your help!
[assigned>=1y]

Schnark claimed this task.

I can no longer reproduce the bug, so let's just close it as resolved.