Page MenuHomePhabricator

[Regression] "Edit on double click" is broken (mw.util.$content undefined)
Closed, ResolvedPublic

Description

Edit on double click does not work on Wikimania 2013.


Version: 1.21.x
Severity: normal

Details

Reference
bz44522

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:24 AM
bzimport set Reference to bz44522.

(In reply to comment #0)

Edit on double click does not work on Wikimania 2013.

Wassat?

So after some playing with this, I found the following:

Exception thrown by mediawiki.action.view.dblClickEdit: mw.util.$content is null
TypeError: mw.util.$content is null

I still have no idea what "Edit on double click" is, sorry. :)
Steps to reproduce are welcome, in general.

thewub.wiki wrote:

It's a Preferences option, under the Editing tab. "Edit pages on double click (requires JavaScript)"

Works for me too with Firefox 17 on Fedora 16.
More info needed to reproduce (browser, system).

FF18.0.1 @ WXPSP2 up-to-date

Works on any other site but WM2013.

Error message provided in comment #2.

No JS gadgets turned on.

Does not work with either debug on or off. In both cases returns the error message.

Doesn't work on any Wikipedia or Commons for me (Mac 10.4.11, Safari).

Moving to JavaScript component, this bug has nothing to do with ResourceLoader whatsoever.

Updating bug to be a general mediawiki regression.

I can't reproduce this bug on latest master

  • Log in
  • Preferences > Editing > [x] Edit on double click
  • Open a random page
  • Double click on content area
  • Edit action opens

Works fine for me in Chrome.

Works for me in Opera, Chrome and FF. Doesn't work in IE9.

In line 5 of mediawiki.action.view.dblClickEdit.js the following statement fails:

mw.util.$content.dblclick

The reason is, that mw.util.$content is null. Running the same JavaScript after everything is loaded works fine, so it seems to be a problem with the order of execution.

The last change to dblClickEdit.js, Ie8a35700bc9e74b24f234ea682ad25375e18bda4, removed the code to execute it on DOMContentLoaded. So now it may be executed before mw.util.$content is set, depending on the order the scripts get loaded and executed. Just re-add the $( document ).ready(), and it probably will work again for all.

Change-Id: I5f0388ae1307302bacebc9aa86bb83ceb82e30fb

Removing "For some" from summary. The "Edit on double click" feature is disabled by default, if you enable it this bug was consistently reproducible for all users on all wikis in all browsers. It was a general code bug, not environmental related.