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.

Kghbln created this task.Mar 6 2018, 4:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 6 2018, 4:40 PM
Kghbln updated the task description. (Show Details)
Kghbln updated the task description. (Show Details)
TheDJ added a subscriber: TheDJ.Nov 13 2018, 1:25 PM

Is this still a problem ?

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
TheDJ added a comment.Nov 13 2018, 1:44 PM

https://github.com/wikimedia/mediawiki-extensions-WikiEditor/compare/277159cd3ae6fdafb7f49db3dbfedfa023e81d35..master

https://github.com/wikimedia/mediawiki-extensions-LiquidThreads/compare/a1ac638a7352af86dee443d8eb444bce04b6a535..master

diffs to master of wikiEditor and LQT. I can't spot the difference that could be responsible for this so far...
Is this a public wiki ? It would make debugging a lot easier.

Kghbln added a comment.EditedNov 13 2018, 1:50 PM

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

TheDJ added a comment.EditedNov 14 2018, 10:40 AM

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

TheDJ added a comment.EditedNov 14 2018, 8:18 PM

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 claimed this task.Nov 14 2018, 8:27 PM
TheDJ triaged this task as Normal 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 closed this task as Resolved.Nov 14 2018, 9:26 PM
Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

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!

TheDJ moved this task from Backlog to Closed on the WikiEditor board.Tue, Nov 27, 1:48 PM