Page MenuHomePhabricator

Can't double-click a page to edit when "Edit pages on double click" preference is enabled
Open, Needs TriagePublic

Description

  1. Log in to Brickimedia.
  2. Go to http://en.brickimedia.org/wiki/Special:Preferences#mw-prefsection-editing
  3. Enable "Edit pages on double click".
  4. Go to http://en.brickimedia.org/wiki/Constable_Clarke in a supported browser.
  5. Double-click the page.

Expected behavior:

The wiki loads the editing interface (http://en.brickimedia.org/w/index.php?title=Constable_Clarke&action=edit).

Observed behavior:

None. No errors logged to the JS console.

Workaround:

Temporarily switch to the Vector skin (http://en.brickimedia.org/wiki/Constable_Clarke?useskin=vector), then double-click the page.

Observed on:

Brickipedia (MW 1.28.1, Refreshed 3.2.2)

PathfinderWiki (MW 1.27.3, Refreshed 3.1.3)

Event Timeline

Oznogon created this task.Jul 4 2017, 6:49 PM

@Oznogon: Thanks for reporting this. I'll try to look into this bug.

SamanthaNguyen moved this task from Backlog to Bugs on the Refreshed board.Jul 4 2017, 6:59 PM
SamanthaNguyen added a comment.EditedJul 4 2017, 7:28 PM

@Oznogon:

Okay, so the problem is that the mediawiki.action.view.dblClickEdit module (at resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js) is trying to check and trigger for a skin-specific selector. See Line 12.

resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js
			if ( parseInt( mw.user.options.get( 'editondblclick' ), 10 ) ) {
				e.preventDefault();
				// Trigger native HTMLElement click instead of opening URL (T45052)
				$a = $( '#ca-edit a' );

Vector

the #ca-edit a selector exists in Vector, here's the HTML that Vector produces below. Since there's an anchor element as a child of #ca-edit, it works.

<li id="ca-edit">
	<span>
		<a href="/w/index.php?title=Main_Page&amp;action=edit" title="Edit this page [alt-shift-e]" accesskey="e">Edit</a>
	</span>
</li>

Refreshed

Here's what Refreshed's HTML looks like (it's different since Refreshed creates its own toolbar out of the page actions):

<a href="/w/index.php?title=Main_Page&amp;action=edit" id="ca-edit" title="Edit this page [alt-shift-e]" accesskey="e">
	<span>Edit</span>
</a>

The difference here is that the anchor element actually has the ca-edit ID, and thus this isn't triggered. Hope this makes sense! Ideally the core module shouldn't be skin-specific. I'll try to figure out how to make a proper solution for this.

Thanks @SamanthaNguyen! That's enough to hack in a workaround for now. I just pasted mediawiki.action.view.dblClickEdit.js into MediaWiki:Refreshed.js and changed the selector.

@SamanthaNguyen Did you ever create an upstream task for this regarding the core module being skin specific? If not that would probably be the best course of action for this task.