Topic on Extension talk:TinyMCE

TinyMCE very slow to load

36
Summary by DuncanCrane

Spaces at the start of lines in html text embedded in the wiki page were causing an error. This has now been fixed on the development Github site master branch (release 1.0.3+). This fix will be included in the next official maintenance release on mediawiki Gerrit v1.1 in Q1 2021

Leaderboard (talkcontribs)

It takes up to 45 seconds to load when editing larger pages, which is way too long. Is there a way to make it faster? WinCache is installed and MediaWiki's file cache is enabled.

DuncanCrane (talkcontribs)

Hi

I'm sorry I haven't passed this way for a while and hadn't spotted you question earlier. There are two likely reasons for the slow loading. The first is the initial load of the javascript and css files, The second is that your page is causing many calls to the mediawiki api parser to interpret parser functions, template calls etc. In either case 45 seconds does seem pretty extreme.

If it is just the initial load of the editor that is taking the time (ie doesn't vary on page size) then would you check your browser's debugger to identify which modules are causing the delay?

If it is on large pages only (or pages with many parser functions etc) then you may want to try the current beta development version (see posts below for where to get the current development version). This newer version will be released in the next month or two, if you'd prefer to wait for an 'official' release?

The newer version batches up nearly all calls to the mediawiki api parser into a single call executed when loading a page into the editor which removes delays introduced by executing many separate calls to the api. This greatly speeds up loading of such pages. Because of the volume of changes needed to introduce this capability, unfortunately, I'm not able to retrofit it to the older version.

Thank you for trying this extension and for your comments and suggestions.

Leaderboard (talkcontribs)

Hi Duncan,

Yes, it mainly happens on long pages, and occasionally fails to load (returns a blank page) in extreme cases. I'll consider trying your beta and will let you know if I run into further issues.

EDIT: I'm getting an internal error on MW 1.34.2 -

MediaWiki internal error.

Original exception: [ce6f52f30991a13c81416fb0] /wiki/index.php?title=Main_Page MWException from line 164 of D:\public_html\betaarchive\wiki\includes\Hooks.php: Invalid callback TinyMCEHooks::addToViewPage in hooks for OutputPageBeforeHTML

Backtrace:

  1. 0 D:\public_html\betaarchive\wiki\includes\Hooks.php(234): Hooks::callHook(string, array, array, NULL, string)
  2. 1 D:\public_html\betaarchive\wiki\includes\OutputPage.php(1948): Hooks::runWithoutAbort(string, array)
  3. 2 D:\public_html\betaarchive\wiki\includes\OutputPage.php(1960): OutputPage->addParserOutputText(ParserOutput, array)
  4. 3 D:\public_html\betaarchive\wiki\includes\page\Article.php(715): OutputPage->addParserOutput(ParserOutput, array)
  5. 4 D:\public_html\betaarchive\wiki\includes\actions\ViewAction.php(63): Article->view()
  6. 5 D:\public_html\betaarchive\wiki\includes\MediaWiki.php(511): ViewAction->show()
  7. 6 D:\public_html\betaarchive\wiki\includes\MediaWiki.php(302): MediaWiki->performAction(Article, Title)
  8. 7 D:\public_html\betaarchive\wiki\includes\MediaWiki.php(900): MediaWiki->performRequest()
  9. 8 D:\public_html\betaarchive\wiki\includes\MediaWiki.php(527): MediaWiki->main()
  10. 9 D:\public_html\betaarchive\wiki\index.php(44): MediaWiki->run()
  11. 10 {main}

Exception caught inside exception handler: [ce6f52f30991a13c81416fb0] /wiki/index.php?title=Main_Page MWException from line 164 of D:\public_html\betaarchive\wiki\includes\Hooks.php: Invalid callback TinyMCEHooks::modifyTalkPageLink in hooks for SkinTemplateTabAction

Backtrace:

  1. 0 D:\public_html\betaarchive\wiki\includes\Hooks.php(202): Hooks::callHook(string, array, array, NULL)
  2. 1 D:\public_html\betaarchive\wiki\includes\skins\SkinTemplate.php(798): Hooks::run(string, array)
  3. 2 D:\public_html\betaarchive\wiki\includes\skins\SkinTemplate.php(933): SkinTemplate->tabAction(Title, string, boolean, string, boolean)
  4. 3 D:\public_html\betaarchive\wiki\includes\skins\SkinTemplate.php(447): SkinTemplate->buildContentNavigationUrls()
  5. 4 D:\public_html\betaarchive\wiki\skins\chameleon\src\Chameleon.php(165): SkinTemplate->prepareQuickTemplate()
  6. 5 D:\public_html\betaarchive\wiki\includes\skins\SkinTemplate.php(215): Skins\Chameleon\Chameleon->prepareQuickTemplate()
  7. 6 D:\public_html\betaarchive\wiki\includes\OutputPage.php(2574): SkinTemplate->outputPage()
  8. 7 D:\public_html\betaarchive\wiki\includes\exception\MWException.php(180): OutputPage->output()
  9. 8 D:\public_html\betaarchive\wiki\includes\exception\MWException.php(216): MWException->reportHTML()
  10. 9 D:\public_html\betaarchive\wiki\includes\exception\MWExceptionHandler.php(119): MWException->report()
  11. 10 D:\public_html\betaarchive\wiki\includes\exception\MWExceptionHandler.php(195): MWExceptionHandler::report(MWException)
  12. 11 D:\public_html\betaarchive\wiki\includes\MediaWiki.php(558): MWExceptionHandler::handleException(MWException)
  13. 12 D:\public_html\betaarchive\wiki\index.php(44): MediaWiki->run()
  14. 13 {main}

DuncanCrane (talkcontribs)

Hi again and thank you for the quick reply. These two callback functions should be defined in the TinyMCE.hooks.php file in the extension root. Would you check this is the case on your system? If they are, it does look for some reason that your system is not picking these up given the error message.

B.T.W. I should have mentioned, there is a sample of the config for LocalSetting.php in the README file on github and I have just added some notes on how this works.

Please do let me know if you are still getting problems

Many thanks, Duncan

Leaderboard (talkcontribs)

Hi Duncan,

No dice. I couldn't find anything called "TinyMCEHooks::addToViewPage" in the hooks.php file, but can see "addToViewPage", not sure if that's what you are looking for (and also checked on the GitHub copy). I tried both configs, the "barebones" one (with only the extension loaded), and the one with all changes, but both return the same error. Not sure how to go from here.

I also tried to switch to Vector, but that also did not help.

DuncanCrane (talkcontribs)

Hi, yes that's right. The call back functions in 'TinyMCE.hooks.php' are called 'addToViewPage' and 'modifyTalkPageLink'. The 'TinyMCEHooks:', I believe, is to tell mediawiki where to find the call back functions. What is strange is that there are several other hooks defined in 'TinyMCE.hooks.php' which aren't causing errors, so mediawiki is finding and processing the hooks ok, apart from these two.

I tried downloading and testing from Github but all works ok for me (I am using 1.31, but I have colleagues who are currently using on 1.34 successfully).

There are a couple of things you could try. First, it may be a conflict with another extension, so it might be worth disabling other extensions and see if that makes a difference. The second thing I noticed is that the 'addToViewPage' call back doesn't end with 'return true' where all the other call backs do. You might try putting 'return true' at the end of the 'addToViewPage' callback in 'TinyMCE.hooks.php'

Thanks for persevering, Duncan

Leaderboard (talkcontribs)

I tried adding "return true;", but got the same error.

DuncanCrane (talkcontribs)

Hi

Would you mind commenting out the 'disableWikiEditor' function in 'TinyMCE.hooks.php' as follows and let me know what you get?

/*	public static function disableWikiEditor( $editPage ) {
		global $wgTinyMCEEnabled;

		if ( $wgTinyMCEEnabled ) {
			return false;
		}
		return true;
	}*/

Many thanks

Leaderboard (talkcontribs)

Hi Duncan,

Unfortunately, I am getting much the same error:

MediaWiki internal error.

Original exception: [b083c004a5d99b107f880a21] /wiki/index.php?title=Main_Page MWException from line 164 of D:\public_html\betaarchive\wiki\includes\Hooks.php: Invalid callback TinyMCEHooks::addToViewPage in hooks for OutputPageBeforeHTML

Backtrace:

  1. 0 D:\public_html\betaarchive\wiki\includes\Hooks.php(234): Hooks::callHook(string, array, array, NULL, string)
  2. 1 D:\public_html\betaarchive\wiki\includes\OutputPage.php(1948): Hooks::runWithoutAbort(string, array)
  3. 2 D:\public_html\betaarchive\wiki\includes\OutputPage.php(1960): OutputPage->addParserOutputText(ParserOutput, array)
  4. 3 D:\public_html\betaarchive\wiki\includes\page\Article.php(715): OutputPage->addParserOutput(ParserOutput, array)
  5. 4 D:\public_html\betaarchive\wiki\includes\actions\ViewAction.php(63): Article->view()
  6. 5 D:\public_html\betaarchive\wiki\includes\MediaWiki.php(511): ViewAction->show()
  7. 6 D:\public_html\betaarchive\wiki\includes\MediaWiki.php(302): MediaWiki->performAction(Article, Title)
  8. 7 D:\public_html\betaarchive\wiki\includes\MediaWiki.php(900): MediaWiki->performRequest()
  9. 8 D:\public_html\betaarchive\wiki\includes\MediaWiki.php(527): MediaWiki->main()
  10. 9 D:\public_html\betaarchive\wiki\index.php(44): MediaWiki->run()
  11. 10 {main}

Exception caught inside exception handler: [b083c004a5d99b107f880a21] /wiki/index.php?title=Main_Page MWException from line 164 of D:\public_html\betaarchive\wiki\includes\Hooks.php: Invalid callback TinyMCEHooks::modifyTalkPageLink in hooks for SkinTemplateTabAction

Backtrace:

  1. 0 D:\public_html\betaarchive\wiki\includes\Hooks.php(202): Hooks::callHook(string, array, array, NULL)
  2. 1 D:\public_html\betaarchive\wiki\includes\skins\SkinTemplate.php(798): Hooks::run(string, array)
  3. 2 D:\public_html\betaarchive\wiki\includes\skins\SkinTemplate.php(933): SkinTemplate->tabAction(Title, string, boolean, string, boolean)
  4. 3 D:\public_html\betaarchive\wiki\includes\skins\SkinTemplate.php(447): SkinTemplate->buildContentNavigationUrls()
  5. 4 D:\public_html\betaarchive\wiki\skins\chameleon\src\Chameleon.php(165): SkinTemplate->prepareQuickTemplate()
  6. 5 D:\public_html\betaarchive\wiki\includes\skins\SkinTemplate.php(215): Skins\Chameleon\Chameleon->prepareQuickTemplate()
  7. 6 D:\public_html\betaarchive\wiki\includes\OutputPage.php(2574): SkinTemplate->outputPage()
  8. 7 D:\public_html\betaarchive\wiki\includes\exception\MWException.php(180): OutputPage->output()
  9. 8 D:\public_html\betaarchive\wiki\includes\exception\MWException.php(216): MWException->reportHTML()
  10. 9 D:\public_html\betaarchive\wiki\includes\exception\MWExceptionHandler.php(119): MWException->report()
  11. 10 D:\public_html\betaarchive\wiki\includes\exception\MWExceptionHandler.php(195): MWExceptionHandler::report(MWException)
  12. 11 D:\public_html\betaarchive\wiki\includes\MediaWiki.php(558): MWExceptionHandler::handleException(MWException)
  13. 12 D:\public_html\betaarchive\wiki\index.php(44): MediaWiki->run()
  14. 13 {main}

.

DuncanCrane (talkcontribs)

Thanks, that is helpful. With the change suggested, you should have also got a backtrace for Invalid callback TinyMCEHooks::disableWikiEditor.

Is it possible that your wiki is picking up some files from the old version of the TinyMCE extension?

Leaderboard (talkcontribs)

Unlikely, because I first renamed the folder to something like TinyMCE_old before copying.

Edit: I decided to try it on a localhost installation. While that one no longer complains, ... nothing happens when I click Edit (or Edit Source). Only the WikiEditor one appears. And I did set TinyMCE to be enabled in LocalSettings.php.

DuncanCrane (talkcontribs)

Thanks again. It is strange that the edit I suggested didn't result in an additional error message as indicated. This would suggest that mediawiki isn't looking at the file you edited.

With the installation on localhost, if error messaging in the wiki is enabled, you should have the same messages as on you remote site. Would you use the browser debugger to see if there are any javascript errors being reported?

Many thanks

Leaderboard (talkcontribs)

Hi Duncan,

I'm not getting any specific errors (in fact, it's the same as if the old version was being used instead)

VM185:33 This page is using the deprecated ResourceLoader module "jquery.tabIndex".
(anonymous) @ VM185:33
runScript @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
execute @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:15
doPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:7
requestIdleCallback (async)
requestPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
setAndPropagate @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
implement @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:20
(anonymous) @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1
VM185:38 This page is using the deprecated ResourceLoader module "jquery.throttle-debounce".
Please use OO.ui.throttle/debounce instead. See https://phabricator.wikimedia.org/T213426
(anonymous) @ VM185:38
runScript @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
execute @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:15
doPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:7
requestIdleCallback (async)
requestPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
setAndPropagate @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
implement @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:20
(anonymous) @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1
load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1235 This page is using the deprecated ResourceLoader module "jquery.ui".
Please use OOUI instead.
mw.loader.implement.css @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1235
runScript @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
(anonymous) @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:14
flushCssBuffer @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:6
requestAnimationFrame (async)
addEmbeddedCSS @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:6
execute @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:14
doPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:7
requestIdleCallback (async)
requestPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
setAndPropagate @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
implement @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:20
(anonymous) @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1
load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:973 JQMIGRATE: jQuery.fn.delegate() is deprecated
migrateWarn @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:973
delegate @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:981
bindHover @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1430
Datepicker @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1385
(anonymous) @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1432
mw.loader.implement.css @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1432
runScript @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
(anonymous) @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:14
flushCssBuffer @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:6
requestAnimationFrame (async)
addEmbeddedCSS @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:6
execute @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:14
doPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:7
requestIdleCallback (async)
requestPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
setAndPropagate @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
implement @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:20
(anonymous) @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1
VM185:39 This page is using the deprecated ResourceLoader module "jquery.ui.button".
Please use the main `jquery.ui` module, not this alias.
(anonymous) @ VM185:39
runScript @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
execute @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:15
doPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:7
requestIdleCallback (async)
requestPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
setAndPropagate @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
markModuleReady @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
runScript @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
(anonymous) @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:14
flushCssBuffer @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:6
requestAnimationFrame (async)
addEmbeddedCSS @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:6
execute @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:14
doPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:7
requestIdleCallback (async)
requestPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
setAndPropagate @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
implement @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:20
(anonymous) @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1
VM185:39 This page is using the deprecated ResourceLoader module "jquery.ui.dialog".
Please use the main `jquery.ui` module, not this alias.
(anonymous) @ VM185:39
runScript @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
execute @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:15
doPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:7
requestIdleCallback (async)
requestPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
setAndPropagate @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
markModuleReady @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
runScript @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
(anonymous) @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:14
flushCssBuffer @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:6
requestAnimationFrame (async)
addEmbeddedCSS @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:6
execute @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:14
doPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:7
requestIdleCallback (async)
requestPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
setAndPropagate @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
implement @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:20
(anonymous) @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1
VM185:39 This page is using the deprecated ResourceLoader module "jquery.ui.draggable".
Please use the main `jquery.ui` module, not this alias.
(anonymous) @ VM185:39
runScript @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
execute @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:15
doPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:7
requestIdleCallback (async)
requestPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
setAndPropagate @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
markModuleReady @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
runScript @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:13
(anonymous) @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:14
flushCssBuffer @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:6
requestAnimationFrame (async)
addEmbeddedCSS @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:6
execute @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:14
doPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:7
requestIdleCallback (async)
requestPropagation @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
setAndPropagate @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:8
implement @ load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=chameleon:20
(anonymous) @ load.php?lang=en-gb&modules=ext.bootstrap.scripts|ext.tinymce.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|jquery.ui|oojs-ui.styles.icons-editing-advanced&skin=chameleon&version=1c3uj:1
VM185:39 This page is using the deprecated ResourceLoader module "jquery.ui.resizable".
Please use the main `jquery.ui` module, not this alias.
DuncanCrane (talkcontribs)

Ok, as far as I can see, on your remote site your wiki appears to be using the wrong version of TinyMCE.hooks.php. I believe this because you didn't get a message 'Invalid callback TinyMCEHooks::disableWikiEditor' when you made the change I suggested.

What I suggest you do now is:

1. delete all versions of the TinyMCE editor form your system,

2. disable other extensions you have installed

3. re download and install the TinyMCE 5 branch using link https://github.com/duncan-crane/TinyMCE/archive/Upgrade-to-TinyMCE-5.zip

4. flush all caches using whatever mechanism applies to your browser

5. put the browser into it's debug mode

6. load up your wiki

If you still get the error, then would you let me have the details of all the versions of what is loaded in your wiki (using the special:version page)?Thanks

DuncanCrane (talkcontribs)

Seems to have gone quiet so closing

Leaderboard (talkcontribs)

My apologies for the delay. Some updates:

  • The new TinyMCE 5 version works on our wiki with MW1.34, however, some tables don't render properly.
  • It still takes a while to load on larger pages.
DuncanCrane (talkcontribs)

Hi Leaderboard and welcome back :-)

Thank you for persevering with the extension.

For the tables that don't render correctly, would you be able to let me have the wiki text version of the table so I can try to reproduce the problem, and solve it hopefully? If you can reduce it to the minimum necessary markup to reproduce the errors that would help :-)

For the time to load, assuming you are familiar with your browsers debugger, are you able to look at a 'network' load times graph or similar? I'm interested in the time it takes to load a page from when it starts to load 'theme.js' to completion of the page load when the page contains the editor.

I'm using a hosting company server over the internet and my initial load time for the editor (clearing cache and hard reload) is about four seconds and , once it is memory, it takes about 0.5 seconds to load on other pages or refreshing the current page. This is with a page with only about a screen full of content and not many links or templates.

If you can bear with me, we will be drilling into this data to see if we can isolate exactly where the delays are occurring. If you are not comfortable with this level of technical activity let me know?

By the way, did you find what was causing the problems before?

Many thanks

Duncan

Leaderboard (talkcontribs)

Unfortunately, I don't quite know what was causing the problems before, in fact I left it back then, and was pleasantly surprised to see it working when I tried again the previous day.

I can send you the table markup, but it would be too large to send here, if you want I can use your talk page or email if that's what you prefer. Same goes for the loading graph.

I think the table issue is related to TinyMCE being slow - it probably reaches some kind of limit and stops there. We are using a dedicated hosting server by the way, so raw speed isn't an issue.

DuncanCrane (talkcontribs)

Thanks, Leaderboard.

Funny that but I'm pleased it's working for you now anyway.

I'm assuming that you are now using the 'official' release V1.0 from here which was released earlier this week? There have been quite a few fixes since you last tried :-)

If so, it would be fine to post the wikitext on my talk page.

Leaderboard (talkcontribs)

Yes, it's V1.0. I'll post the wikitext in your talk page.

DuncanCrane (talkcontribs)

Hi Leaderboard, thanks I have the example wiki text.

I'm not sure if it copied correctly as what is there doesn't seem to be a table as such, as it only has an html table opening tag and now row, column or cell tags?

As it's quite early, my service is running a bit faster today :-). This page loaded in the TinyMCE Editor without the debugger in under 2 seconds. With the debugger running, so I can see the relative load speeds of different modules, loading the page and editor took 4 seconds on initial load and under 1 second once already in memory.

I have noticed some strange formatting artefacts in the TinyMCE editor which don't match the rendered wiki page which I'll have a look into later,.

I don't think there is anything, per se, in your page as it is currently that causes TinyMCE any performance problems. I have users with tables of several thousands of cells in a table that find performance is pretty good. As mentioned above though, maybe something got lost in the copy and paste?

DuncanCrane (talk) 09:12, 28 November 2020 (UTC)

Leaderboard (talkcontribs)
DuncanCrane (talkcontribs)

Thanks - got that now Leaderboard.

I initially loaded it and it took 8 seconds which seemed way too long. Also the formatting was incorrect as you said too.

I noticed that your table cells each have a space in front of them. I removed these and it loaded so quick I hadn't even started to time it, and formatting was perfect :-)

So what we have is a bug, fortunately. In normal wiki text, a space before a line, or every line in a block, results in the line(s) being converted into a <pre> block when the page is rendered, which you probably know. However, if these lines with spaces occur within an html construct in the wiki text, they are ignored by the mediawiki parser when creating the page to render.

I was aware that spaces at the start of lines in embedded html should be ignored and have logic that is meant to deal with it, but for some reason that doesn't seem to have worked with embedded html tables! So what we are left with is a bunch of table rows with <pre> blocks in them. The html validator within TinyMCE knows this isn't valid html and tries to fix it. So what it does is put all the <pre> blocks in the page before the table and then a table of just headers after. That explains the weird formatting, at least.

I'm not sure yet why it was taking so long processing the <pre> blocks. I'll have to investigate that further, but if I fix the space at start of lines in embedded tables, that at least should get you up and running.

Thanks for finding the bug.

DuncanCrane (talkcontribs)

(edited) Oh BTW, the TinyMCE editor interface will convert embedded html table markup to wiki table markup. Once the page is rendered it should look identical, of course. This is because html and wiki table markup can't be used together in the same table so it was easiest to standardise on just one. Wiki markup takes less space and is possibly clearer..

DuncanCrane (talkcontribs)

Hi Leaderboard

I just added a fix for this, and a few other minor bugs, to the master branch on Github here

This is the development repository rather than the 'official' release on Gerrit. There will be a maintenance release to Gerrit in due course, but you might want to try out this fix now?

If you do, please let me know how it goes and if you experience any other problems.

Many thanks DuncanCrane (talk) 13:33, 29 November 2020 (UTC)

DuncanCrane (talkcontribs)

Hi @Leaderboard

I wondered if you had a chance to try this yet and if it worked for you?

DuncanCrane (talk) 15:30, 8 December 2020 (UTC)

Leaderboard (talkcontribs)

Has the fix been integrated into Gerrit (that is, would downloading the master release contain the fix)?

DuncanCrane (talkcontribs)

Hi Sorry, not yet. You possibly missed that I put the changes on my Github master branch (see post on 29th Nov above for link). There's a few other minor fixes and I plan to update Gerrit once my Dutch chums have regression tested these, probably early in the new year now. DuncanCrane (talk) 11:59, 13 December 2020 (UTC)

Leaderboard (talkcontribs)

Hi Duncan, didn't get the chance yet, will let you know when I do so.

Leaderboard (talkcontribs)

Hi Duncan, tried it and the bugs seem to be fixed. However, on the top there appears to be a stray ⧼tinymce-notice⧽ line on top, but functionality isn't otherwise affected.

DuncanCrane (talkcontribs)

Hi Leaderboard, sorry I didn't see this earlier.

It's great that the bug is now fixed, thank you for persevering with it.

The appearance of ⧼tinymce-notice⧽ would suggest there is a label 'tinymce-notice' in the user interface that has no equivalent translation in the TinyMCE/i18n translation file for the language you are using. This would be en.json for english wikis.

Would you be able to provide a little more information to help me locate the problem, as it is not something I've come across myself? The most helpful would be to give me a screen capture of where it appears in the user interface. If you can also go into your browser debug mode and let me have a copy of the html element that cause the ⧼tinymce-notice⧽ to display that would also be very helpful.

Many thanks

Duncan

Leaderboard (talkcontribs)

Hi Duncan,

The XPath where ⧼tinymce-notice⧽ appears is /html/body/div[1]/div[2]/div/div/div[3]/div[1]/p.

This would be the image you are looking for:
.

DuncanCrane (talkcontribs)

Thanks Leaderboard

Unfortunately I'm not able to find that xpath (possibly why I don't get the tinymce-notice either). Are you able to give me an id or class for the element?

Thanks, Duncan

DuncanCrane (talkcontribs)

Ok, got it (I think)

The message 'tinymce-notice is used when creating the content of a page. I'm not sure why as I didn't write that bit of the code :-( but I suspect is possibly there for use by an extension that uses TinyMCE. Still the good news is that the message by default is empty.

In the file 'en.json' in extension directory '/i18n' the following should be one of the entries:

	"tinymce-notice": "",

This is present in the en.json file in GitHub so I'm a little perplexed that you get ⧼tinymce-notice⧽ as this should have been replaced by the empty message from the en.json file.

Would you mind checking the en.json file for this message and, if it's not there, would you mind adding it to see if the message then disappears?

Many thanks, Duncan

Leaderboard (talkcontribs)

OK, I think I figured out what the problem was. Your repo (https://github.com/duncan-crane/TinyMCE/tree/master/i18n) didn't actually have the en.json file at all, and they were apparently added only a few days back. I redownloaded the extension again and the problems seem to have been fixed (for now).

DuncanCrane (talkcontribs)

Great. Sorry, for some reason I must have removed the language files between v1.0.1 and v1.0.2. Let me know if you hit any other issues :-)