Page MenuHomePhabricator

WikiEditor toolbar shown twice on editing posts in threads
Closed, ResolvedPublic

Description

Setup

  • MediaWiki 1.31.0-alpha
  • HHVM 3.24.3 (srv)
  • MariaDB 10.0.31-MariaDB-0ubuntu0.16.04.2
  • Liquid Threads 2.3-alpha
  • WikiEditor 0.5.1

Issue
WikiEditor toolbar is being shown twice on editing posts in threads. See screen shot. Console reports

TypeError: mw.util is undefined
[Further information]
load.php:2:170
<anonym>
https://translatewiki.net/w/load.php:2:170
mightThrow
https://translatewiki.net/w/load.php:49:590
resolve/</process<
https://translatewiki.net/w/load.php:50:269

I am however not sure if this is related.

Bildschirmfoto vom 2018-03-06 17-39-09.png (809×1 px, 67 KB)

Event Timeline

Kghbln updated the task description. (Show Details)
Kghbln updated the task description. (Show Details)

Is this still a problem ?

No longer on translatewiki.net. However I have a wiki on REL1_31 for LQT and WE which still shows this behaviour (see below). So something needs to be back-ported I believe.

  • MediaWiki 1.31.1 (a013eed) 10:46, 31 October 2018
  • Liquid Threads 2.3-alpha (a1ac638) 21:12, 16 April 2018
  • WikiEditor 0.5.1 (277159c) 21:03, 5 May 2018

diffs to master of wikiEditor and LQT. I can't spot the difference that could be responsible for this so far...

Perhaps this was something with MediaWiki itself?

Luckily it is a public wiki:

Error: Widget not found load.php:1035:645
	OO.ui.Element.static.unsafeInfuse https://www.semantic-mediawiki.org/w/load.php:1035:645
	OO.ui.Element.static.infuse https://www.semantic-mediawiki.org/w/load.php:1035:116
	OO.ui.infuse https://www.semantic-mediawiki.org/w/load.php:1031:957
	<anonym> https://www.semantic-mediawiki.org/w/load.php:2:839
	mightThrow https://www.semantic-mediawiki.org/w/load.php:49:590
	resolve/</process< https://www.semantic-mediawiki.org/w/load.php:50:269

Basically it is the same issue as initially reported.

And in action

The infuse is not related to this.

LQT adds the toolbar config by itself en wikiEditor itself does it a second time on its own:

if (!$('#wpTextbox1').data('wikiEditor-context')) {
    $('#wpTextbox1').wikiEditor('addModule', $.wikiEditor.modules.toolbar.config.getDefaultConfig());
    $('#wpTextbox1').wikiEditor('addModule', $.wikiEditor.modules.dialogs.config.getDefaultConfig());
}

This problem was introduced by the changes of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikiEditor/+/392902 T165112: Kill of most/all the WikiEditor RL modules

LQT used to only load the base framework of WikiEditor, after which it would manually load the toolbar portions it needed. After those changes, the base framework of the editor already includes the toolbar, so if LQT adds it as well, it might be added twice. This issue is also race condition sensitive, which explains why in certain setups it might not show, and in others it will.

The infuse is not related to this.

Ah, ok, it's just what popped up prominently in console.

This issue is also race condition sensitive, which explains why in certain setups it might not show, and in others it will.

This may be true since today I had this two out of three times. Probably this issue is not fixed in translatewiki.net either.

Change 473594 had a related patch set uploaded (by TheDJ; owner: TheDJ):
[mediawiki/extensions/WikiEditor@master] Modules: Protect against loading modules twice

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

Change 473596 had a related patch set uploaded (by TheDJ; owner: TheDJ):
[mediawiki/extensions/LiquidThreads@master] LQT: $.wikiEditor.isSupported was removed from WE2010

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

So.. the wikiEditor patch avoids the double load, and when backported to 1.31, 1.32 and 1.33 (yikes...) should fix this ticket. I could remove the double load from lqt, but really this was always not entirely safe in WikiEditor, so might as well fix it there and this way, we don't FU the lqt compatibility with various branches even further.

Is supported was removed in 1.32, so that LQT patch should be backported to 1.32 and 1.33 branches of LQT.

I also found https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/LiquidThreads/+/473595/ so fixed that too (not critical for backports however)

Change 473606 had a related patch set uploaded (by TheDJ; owner: TheDJ):
[mediawiki/extensions/LiquidThreads@REL1_32] LQT: $.wikiEditor.isSupported was removed from WE2010

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

TheDJ triaged this task as Medium priority.

Change 473596 merged by jenkins-bot:
[mediawiki/extensions/LiquidThreads@master] LQT: $.wikiEditor.isSupported was removed from WE2010

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

Change 473606 merged by jenkins-bot:
[mediawiki/extensions/LiquidThreads@REL1_32] LQT: $.wikiEditor.isSupported was removed from WE2010

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

Change 473594 merged by jenkins-bot:
[mediawiki/extensions/WikiEditor@master] Modules: Protect against loading modules twice

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

Change 473619 had a related patch set uploaded (by Jforrester; owner: TheDJ):
[mediawiki/extensions/WikiEditor@REL1_32] Modules: Protect against loading modules twice

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

Change 473620 had a related patch set uploaded (by Jforrester; owner: TheDJ):
[mediawiki/extensions/WikiEditor@REL1_31] Modules: Protect against loading modules twice

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

Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF subscribed.

So.. the wikiEditor patch avoids the double load, and when backported to 1.31, 1.32 and 1.33 (yikes...) should fix this ticket. I could remove the double load from lqt, but really this was always not entirely safe in WikiEditor, so might as well fix it there and this way, we don't FU the lqt compatibility with various branches even further.

Merged and back-ported to 1.31 (it will go out with 1.31.2 in the tarball) and 1.32 (we're still at RC stage, so it'll go out with 1.32.0). 1.33 isn't cut yet, so people using the pre-alpha WMF branches should update to a later one (or direct to master) to get the fix.

Is supported was removed in 1.32, so that LQT patch should be backported to 1.32 and 1.33 branches of LQT.

Done for 1.32. See above re. 1.33.

Change 473619 merged by jenkins-bot:
[mediawiki/extensions/WikiEditor@REL1_32] Modules: Protect against loading modules twice

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

Change 473620 merged by jenkins-bot:
[mediawiki/extensions/WikiEditor@REL1_31] Modules: Protect against loading modules twice

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

Thanks a lot for dealing this. This is much appreciated! I am sorry that it took me so long to test: Affirmative, it is no longer happening!