Extension talk:TinyMCE

About this board

If you have a bug report please post it On the phabricator site for this extension

Textbox grows infinitely with Citizen skin (thus unable to save edits)

4
Lulullia (talkcontribs)

Hi, I just installed the Citizen skin in my private wiki. The regular editor works fine.

When I try to edit a page with TinyMCE editor though, the textbox (where we make edits) just expands infinitely, and I can never reach the bottom of the page as a result (so I can't save my edits). When I inspected the element, the height of it just kept increasing on and on, it even reached 60k pixels before I closed the page!


I'm running latest MediaWiki 1.37. No other extensions (other than pre-installed ones).

Also, I had already tested TinyMCE with Timeless skin and there were no problems. That's a very weird bug...


I hope you can find a solution! Thanks!

Lulullia (talkcontribs)

After tinkering a bit more with the Inspector, I found that the issue may be coming from this css:

.tox .tox-edit-area__iframe {

  height: 100%;

}

When I disable/change the value of "height", the text area returns to normal size and no longer expands.


I also found that disabling "display: flex" on the iframe's parents removes the problem, but of course it renders the editor unusable so it's not a viable workaround.

DuncanCrane (talkcontribs)

Hi Lulullia Thank you for using TinyMCE and letting me know about this issue (and also investigating it). I haven't had the problem reported before, so it looks like it may be something to do with how the Citizen skin works. Several other skins have been used with TinyMCE successfully so I don't think this is a bug with TinyMCE as such. The height setting you identify is part of standard TinyMCE setup. You could try redefining it in the MW_tinymce.css file in the extension root directory as a workaround? You might also ask the extension developers if they have any ideas. Do let me know how you get on. Many thanks Duncan

Lulullia (talkcontribs)

Hi,

I have started a thread on the Citizen skin's page and someone who was having the same issue as me found a workaround in disabling the plugin "autoresizer" (bundled with TinyMCE).

Here is the original message. It works great for me right now so I can close the issue but I thought maybe you'd want to investigate more.

Thanks for the support!

Reply to "Textbox grows infinitely with Citizen skin (thus unable to save edits)"

TinyMCE Editor MediaWiki 1.37

3
Summary by DuncanCrane

A new topic Upload and display file - Problem with TinyMCE has been added that supercedes this one

2A02:8070:1C3:3440:4EF:58E4:F872:FB4E (talkcontribs)

TINY MCE Problems.... upload and display file does not work


dialog for uploading a file.  One can upload from a local disk, from a url or just link to another file already uploaded to the wiki---- i already uploaded Files .jpg... but i can not use the dialog for that files... nothing happens Than!

Stuttgarter2006 (talkcontribs)

i wanted to upload a scrennshot but its not allowed here..

Ciencia Al Poder (talkcontribs)

Open developer console of your browser (by hitting the F12 key), switch to the console tab, clear all its contents, do the same on the network tab, and try the upload or select a file again.

Then look for errors appearing here and also the network tab in case the error comes from a network request. Any error you get from there may be useful to debug the problem.

Cannot upload Images and problems with edit links not calling the TinyMCE editor

49
Summary by DuncanCrane

Issues resolved in V1.0 of the TinyMCE extension. Currently bug fixes can be found in the development master branch on Github her https://github.com/duncan-crane/TinyMCE

These will be included in the next maintenance release of the extension on Mediawiki Gerrit which will be numbered 1.0.1

2A02:8070:E186:4300:3423:C1F8:7131:C2D2 (talkcontribs)

I drag and drop an image into the editor. First a loading bar appears briefly

Shortly after that, a modal is included:

"I'm sorry, you have encountered an error trying to upload to this wiki : File upload parameter "file" is not a file upload; be sure to use multipart/form-data for your POST and include a filename in the Content-Disposition header.. If this continues please contact your administrator"


MediaWiki 3.1.5

PHP 7.3.24

mySQL 5.7.30


Thanks for your help

DuncanCrane (talkcontribs)

Hi

Thank you for trying this extension and I'm sorry you've experienced some problems. You might like to try the new version released earlier today.

2A02:8070:E186:4300:1929:A742:71F2:77FA (talkcontribs)

Thanks for your feedback.

After upgrading to the new version nothing happens. I get the default editor and not the Tiny Editor.


Localconfig included:


# Editor

wfLoadExtension( 'TinyMCE' );

$wgTinyMCEEnabled = true;

DuncanCrane (talkcontribs)

Hi,

Would you check a couple of things for me?

Firstly, if you look at 'special pages, versions' does it show TinyMCE as installed?

See if TinyMCE is installed on special pages, versions






If you go to user preferences would you check 'use TinyMCE' is selected on the 'editing' tab.

2A02:8070:E186:4300:1929:A742:71F2:77FA (talkcontribs)

unfortunately I can't upload pictures, but on the version page TinyMCE is entered and under the options the hook is also activated.

DuncanCrane (talkcontribs)

Thanks.

I'm not sure when you mention the hook you also checked you'd enabled TinyMCE as part of your personal preferences, but assuming you have, would you next do the following.

Go to a wiki page and open it using the 'edit' tab.

'right' click in the browser window and choose 'inspect' (if you are using Chrome) or 'inspect element' (if you are using firefox).

Then refresh the page and check the 'console' tab in the inspector. Would you let me know what messages you receive in the console, if any?

Also a couple of other things. Above you say you are using MediaWiki 3.1.5. By that did you mean 1.35?

Also in your personal preferences, have you switched off Visual Editor?

Disable visual editor
2A02:8070:E186:4300:1929:A742:71F2:77FA (talkcontribs)

sorry i was useing a translator. my english is not the best ^.^

the console says following:

[9ac603d9d1ce3a654e702306] /load.php?lang=de&modules=startup&only=scripts&raw=1&skin=pivot   BadMethodCallException from line 851 of --path--\includes\session\SessionManager.php: Sessions are disabled for this entry point

Backtrace:

#0 --path--\includes\session\SessionManager.php(334): MediaWiki\Session\SessionManager->getSessionFromInfo(MediaWiki\Session\SessionInfo, WebRequest)

#1 --path--\includes\session\SessionManager.php(268): MediaWiki\Session\SessionManager->getEmptySessionInternal(WebRequest)

#2 --path--\includes\session\SessionManager.php(218): MediaWiki\Session\SessionManager->getEmptySession(WebRequest)

#3 --path--\includes\WebRequest.php(826): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)

#4 --path--\includes\user\User.php(1221): WebRequest->getSession()

#5 --path--\includes\user\User.php(388): User->loadFromSession()

#6 --path--\includes\user\User.php(2125): User->load()

#7 --path--\includes\user\User.php(3064): User->getId()

#8 --path--\includes\Permissions\PermissionManager.php(1363): User->isRegistered()

#9 --path--\includes\Permissions\PermissionManager.php(1292): MediaWiki\Permissions\PermissionManager->getRightsCacheKey(User)

#10 --path--\includes\Permissions\PermissionManager.php(1244): MediaWiki\Permissions\PermissionManager->getUserPermissions(User)

#11 --path--\includes\user\User.php(3156): MediaWiki\Permissions\PermissionManager->userHasRight(User, string)

#12 --path--\LocalSettings.php(207): User->isAllowed(string)

#13 --path--\includes\HookContainer\HookContainer.php(320): disableSomeSpecialPages(array)

#14 --path--\includes\HookContainer\HookContainer.php(131): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)

#15 --path--\includes\HookContainer\HookRunner.php(3771): MediaWiki\HookContainer\HookContainer->run(string, array)

#16 --path--\includes\specialpage\SpecialPageFactory.php(347): MediaWiki\HookContainer\HookRunner->onSpecialPage_initList(array)

#17 --path--\includes\specialpage\SpecialPageFactory.php(362): MediaWiki\SpecialPage\SpecialPageFactory->getPageList()

#18 --path--\includes\specialpage\SpecialPageFactory.php(722): MediaWiki\SpecialPage\SpecialPageFactory->getAliasList()

#19 --path--\includes\specialpage\SpecialPage.php(109): MediaWiki\SpecialPage\SpecialPageFactory->getLocalNameFor(string, boolean)

#20 --path--\includes\specialpage\SpecialPage.php(94): SpecialPage::getTitleValueFor(string, boolean, string)

#21 --path--\includes\specialpage\ChangesListSpecialPage.php(873): SpecialPage::getTitleFor(string)

#22 --path--\includes\resourceloader\ResourceLoaderFileModule.php(1216): ChangesListSpecialPage::getRcFiltersConfigSummary(ResourceLoaderContext, GlobalVarConfig, NULL)

#23 --path--\includes\resourceloader\ResourceLoaderFileModule.php(619): ResourceLoaderFileModule->expandPackageFiles(ResourceLoaderContext)

#24 --path--\includes\resourceloader\ResourceLoaderModule.php(842): ResourceLoaderFileModule->getDefinitionSummary(ResourceLoaderContext)

#25 --path--\includes\resourceloader\ResourceLoaderStartUpModule.php(209): ResourceLoaderModule->getVersionHash(ResourceLoaderContext)

#26 --path--\includes\resourceloader\ResourceLoaderStartUpModule.php(405): ResourceLoaderStartUpModule->getModuleRegistrations(ResourceLoaderContext)

#27 --path--\includes\resourceloader\ResourceLoaderModule.php(736): ResourceLoaderStartUpModule->getScript(ResourceLoaderContext)

#28 --path--\includes\resourceloader\ResourceLoaderModule.php(704): ResourceLoaderModule->buildContent(ResourceLoaderContext)

#29 --path--\includes\resourceloader\ResourceLoaderModule.php(839): ResourceLoaderModule->getModuleContent(ResourceLoaderContext)

#30 --path--\includes\resourceloader\ResourceLoader.php(775): ResourceLoaderModule->getVersionHash(ResourceLoaderContext)

#31 [internal function]: ResourceLoader->{closure}(string)

#32 --path--\includes\resourceloader\ResourceLoader.php(787): array_map(Closure, array)

#33 --path--\includes\resourceloader\ResourceLoader.php(874): ResourceLoader->getCombinedVersion(ResourceLoaderContext, array)

#34 --path--\load.php(51): ResourceLoader->respond(ResourceLoaderContext)

#35 --path--\load.php(38): wfLoadMain()

#36 {main}


visualeditor is not installed / not activated


we use the latestet version. i meant 3.15 - sorry


cheers and have a nice weekend

2A02:8070:E186:4300:1929:A742:71F2:77FA (talkcontribs)

but the error from the console is also displayed on normal pages. probably has less to do with your extension?

DuncanCrane (talkcontribs)

Thanks - seems to me your English is pretty good :-)

The errors don't seem directly related, as you said, but it may be that something else is interfering with the TinyMCE load. You could try adding the following to your LocalSetting.php just after where you have $wgTinyMCEEnabled = true;

$wgTinyMCESettings = array(

".tinymce, #wpTextbox1" => array (

  "tinyMCEDebugFlags" => array(

'settings' => 'false',

'debug' => 'true',

'anteOnBeforeSetContent' => 'false',

'anteOnGetContent' => 'false',

'anteOnPastePostProcess' => 'false',

'postOnBeforeSetContent' => 'false',

'postOnGetContent' => 'false',

'postOnPastePostProcess' => 'false'

)

)

);

If you do this and reload the editing page as described above, the process should stop in the debugger when it is initialising TinyMCE. If it doesn't then it is likely that TinyMCE hasn't been loaded for some reason.

Maybe you could also try disabling any other user specified extensions and configuration in LocalSetting.php so we can make sure there aren't any conflicts?

Another thing you could try is to add the following to the top of your LocalSetting.php file to see if mediawiki is getting any other errors?

error_reporting( -1 );

ini_set( 'display_errors', 1 );

Thanks, hope you have a good weekend too

Duncan

DuncanCrane (talkcontribs)

Something else you could try is to change the url in the address bar of your browser. If you edit a page you will see something like this in the address bar.

Talk:Main_Page&action=edit

If you then change the '=edit' to '=tinymceedit' and hit return your wiki should load the TinyMCE editor if it is available.

Would you give this a try and let me know what happens?

2A02:8070:E186:4300:6E:1F87:CB9D:5FD3 (talkcontribs)

hello duncan,

hehe many thanks! (:

the first adjustment with the array did not show any effect. only the wiki standard editor was displayed.

after that i deleted all additional entries in the localconfig. so the above mentioned error with the load was not there anymore. but this did not change the behaviour of tinymce.

adjusting the querys from action=edit to action=tinymceedit worked. i had to click on the debugger a few times during loading. the upload of pictures worked too.

can i get a grip on the fact that i can access the editor without special tinymceedit input and that it runs without debugging steps?

thanks

niko

DuncanCrane (talkcontribs)

Hi Niko Great, some progress. At least we know that the TinyMCE editor is loaded. To remove the debugging steps all you have to do is remove the array in LocalSettings.php. However, we might want to hang on to the debugger steps for a while until we resolve the problem at least.

I'm not sure how familiar you are with mediawiki programming so if the next paragraph doesn't mean anything to you, just ignore it :-)

The TinyMCE extension uses hooks into mediawiki in order to create the edit links. I suspect that for some reason, the TinyMCE extension is not recognising edit links so isn't changing them to call the TinyMCE editor. When you hover over a 'red link' on a page it should have 'pagename&action=tinymceedit' where pagename is the name of the page being linked to and not 'pagename&action=edit'.

I see above that you are using the 'pivot' skin so I wonder if this maybe where the problem is? Could you try switching to the 'vector' skin, just for now, to see if you still get the problem?

2A02:8070:E186:4300:6E:1F87:CB9D:5FD3 (talkcontribs)

hello and thanks for the feedback (:

i have already deleted the array during the tests with tinymceedit. the debug steps appear nevertheless.

when i click on a red link hover the following appears: index.php?title=Testpage&action=edit&section=1

activating the vector skin did not change the behavior.

BTW the latest pivot version is used.

Thanks for your help

Niko

DuncanCrane (talkcontribs)

Hi Niko

It would be useful to know what lines in the TinyMCE editor that the debugger is stopping on. Perhaps you could give some examples, thanks?

B.T.W. did you purge the cache after switching to the Vector skin? Sometimes it takes a while for mediawiki to register a switch?

I presume that you are still getting the unrelated error printout that you reported above? Would you let me have the first few lines of that printout when you have the vector skin installed? They should look similar to:

[9ac603d9d1ce3a654e702306] /load.php?lang=de&modules=startup&only=scripts&raw=1&skin=pivot   BadMethodCallException from line 851 of --path--\includes\session\SessionManager.php: Sessions are disabled for this entry point
2A02:8070:E186:4300:8B9:461B:5241:C096 (talkcontribs)

hola duncan,

following lines were triggered by the debugger:


load.php - line 29:

console.log("TinyMCE Extension version "+v+" Debug Log on selector "+id+" for "+scope+" at "+d);console.log(print_r(text));console.log("END LOG");console.log("");}if(tinyMCEDebugFlags.debug='true')debugger;}


yep, the error still appears:

[2389ac30680e13413bd1b14f] /load.php?lang=de&modules=startup&only=scripts&raw=1&skin=vector   BadMethodCallException from line 851 of sitenameincludes\session\SessionManager.php: Sessions are disabled for this entry point

Backtrace:

#0 sitenameincludes\session\SessionManager.php(220): MediaWiki\Session\SessionManager->getSessionFromInfo(MediaWiki\Session\SessionInfo, WebRequest)

#1 sitenameincludes\WebRequest.php(826): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)

#2 sitenameincludes\user\User.php(1221): WebRequest->getSession()

#3 sitenameincludes\user\User.php(388): User->loadFromSession()

#4 sitenameincludes\user\User.php(2125): User->load()

#5 sitenameincludes\user\User.php(3064): User->getId()

#6 sitenameincludes\Permissions\PermissionManager.php(1363): User->isRegistered()

#7 sitenameincludes\Permissions\PermissionManager.php(1292): MediaWiki\Permissions\PermissionManager->getRightsCacheKey(User)

#8 sitenameincludes\Permissions\PermissionManager.php(1244): MediaWiki\Permissions\PermissionManager->getUserPermissions(User)

#9 sitenameincludes\user\User.php(3156): MediaWiki\Permissions\PermissionManager->userHasRight(User, string)

#10 sitenameLocalSettings.php(208): User->isAllowed(string)

#11 sitenameincludes\HookContainer\HookContainer.php(320): disableSomeSpecialPages(array)

#12 sitenameincludes\HookContainer\HookContainer.php(131): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)


thanks for your help

niko

DuncanCrane (talkcontribs)

Thanks Niko

The appearance of those debug statements when the array is not set is a bug, well found:-)

The code 'if(tinyMCEDebugFlags.debug='true')debugger;' in the output you reported should read 'if(tinyMCEDebugFlags.debug=='true')debugger;' so I will put a patch in for that.

This wouldn't cause a problem with the editor though. The error being reported isn't caused by the TinyMCE editor, at least not directly as far as I can tell from the backtrace. However, it does appear to be generated from line 208 in your LocalSettings.php file where it appears there is an function call 'User->isAllowed(string)'.

This function call was deprecated in MW 1.34 which may be why you are getting that error and I guess it may be possible that this is then affecting the way TinyMCE is trying to process the 'red links' to point at the TinyMCE editor.

I had something similar and was given the following link for an example of how to replace this function call using the permission manager here

Would it be possible to try that fix, or at least temporarily disable the code including the 'User->isAllowed(string)' to see what happens?

I also tried using the pivot skin but it caused the browsers local storage to be exceeded. This is a strange condition because it actually has to be manually cleared else it will persist across all browser sessions. It doesn't help to clear the cache or even reboot the system. Also it is not reported as a fatal error, just a warning. This error was preventing some extensions loading properly including TinyMCE. When you switch to the vector skin, it may be worth clearing the browser's local storage. Entering something like localStorage.clear() in the console should do the trick.

2A02:8070:E186:4300:8B9:461B:5241:C096 (talkcontribs)

hola duncan,


you were right. line 208 caused the error. after removing it, the wiki loads without error.

thanks for the workaround - i will have a look at it in a moment.


but this did not change the tinymce behaviour. when i click on edit the normal editor appears. if i enter action=tinymceedit in the query, the correct editor appears and seems to work correctly - except for the debugger that comes all the time.


i have just downloaded and integrated the latest version of the vector skin.

as soon as the skin is activated, i unfortunately always get an error:


Fatal error: Uncaught Error: Call to undefined method SkinVector::getPortletData() in sitename\skins\Vector\includes\SkinVector.php:273 Stack trace: #0 sitename\skins\Vector\includes\SkinVector. php(233): SkinVector->getMenuData('navigation', Array, 3) #1 sitename\skins\Vector\includes\SkinVector.php(133): SkinVector->getTemplateDataSidebar() #2 sitename\includes\skins\SkinMustache. php(59): SkinVector->getTemplateData() #3 sitename\includes\skins\SkinTemplate.php(144): SkinMustache->generateHTML() #4 sitename\includes\OutputPage. php(2615): SkinTemplate->outputPage() #5 sitename\includes\exception\MWExceptionRenderer.php(153): OutputPage->output() #6 sitename\includes\exception\MWExceptionRenderer.php(65): MWExceptionRenderer::reportHTML(Object(Error)) #7 sitename\includes\exception\MWExceptionHandler.php(106): MWExcepti in sitename\skins\Vector\includes\SkinVector.php on line 273


so i don't get to the place to test anymore.

i have loaded the cache with CTRL+F5 before and emptied the cache with the browser for testing. Now also with your variant. Unfortunately this does not change the problem. :(


thanks for your help <3

DuncanCrane (talkcontribs)

Oh, that doesn't look good, Niko.

Vector is the mediawiki default skin so something else must be going on in your setup to cause this problem, I suspect.

I'm not sure I can help you with that, so perhaps we should focus on the issue in the pivot skin, but thanks for trying.

I'm in a conference session at the moment but will give it some more thought and get back to you.

DuncanCrane (talkcontribs)

Hi Niko

So I now have pivot working on my MW 1.35 site. Clearing local storage fixed the problem I was having there :-)

On my site, everything is working as expected with the TinyMCE editor being called for new pages and existing pages as expected and the 'edit source' action being added to access the wikitext editor. It even works in Page Forms!

This suggests that there may be a conflict with options you have set for the pivot skin or with other config or extensions you have installed. Is it possible to disable all user config and extensions, apart from the Pivot skin and TinyMCE, and try that? I'd also recommend that you clear local storage again after disabling the other config but before reloading your wiki.

2A02:8070:E186:4300:8B9:461B:5241:C096 (talkcontribs)

Thanks for your feedback.


I have now done a complete cleaninstall of the WIKI. Vector works now. TinyMCE unfortunately still not. It is activated and is displayed correctly on the version page.


When I hover the mouse over the edit link, I get index.php?title=Testseite&action=edit&section=1 displayed.

If I click on it, I land on the edit page. But there I see the normal editor again and not TinyMCE.


Thanks for your effort

Moins de (talkcontribs)

i think it's time for a user here... not so easy to find a name where it is allowed :D

just saw the bug in the console:

TypeError: can't access property "split", tinyMCETagList is null


damn... but not even as a user i can post the complete excerpt of the error... spam protection ._.

picture upload goes wrong too...

DuncanCrane (talkcontribs)

Hi Niko

Aha, some progress. Good.

The error you spotted is because none of the 'standard' tags were found which would include things like includeonly, onlyinclude, noinclude, nowiki. This variable tinyMCETagList is populated from a mediawiki global variable set in a file, TinyMCE.hooks.php, in the root folder of the TinyMCE extension. This is also the file where the links are changed to point to TinyMCE if it is enabled.

Since the tags includeonly, onlyinclude, noinclude, nowiki are hard coded into the mediawiki global, the error you observe would only happen if TinyMCE.hooks.php or the file that calls it, extension.json is somehow corrupted, out of date or not getting loaded correctly.

The first step to check this, I think, is to delete or rename the current TinyMCE extension folder in your wiki. Then re-download the TinyMCE extension from here. Then unpack the 'tar' file and place the 'mediawiki-extensions-TinyMCE-master' directory folder into the '/extensions/' folder of your wiki and rename it to TinyMCE.

Would you let me know if you then still get the same warning as before?

Moins de (talkcontribs)

hola DuncanCrane,


thanks for your feedback (:


i reinstalled the exctension like you said. but jep.. i get the following error codes:


JQMIGRATE: Migrate is installed with logging active, version 3.1.0

Exception in module-execute in module ext.tinymce:

TypeError: can't access property "split", tinyMCETagList is null

JQMIGRATE: jQuery(window).on('load'...) called after load event occurred

DuncanCrane (talkcontribs)

Thanks Niko.

OK, step 2!

So this does appear to be a problem with the mediawiki load on the server side. Unfortunately the browser console only tells us about the errors on the client side!

To get some additional information about possible errors on the server side, would you add the following lines in your LocalSetting.php files at the top. That is after the '<?php' line and lines starting with a '#'.

$wgDebugToolbar = true;
$wgShowExceptionDetails = true;
error_reporting( -1 );
ini_set( 'display_errors', 1 );

If you now reload the browser window, You should see something like this at the bottom of the window.


If you do, would you look in the console tab and copy anything you find here?

Moins de (talkcontribs)

here we go (:


Use of Sanitizer::escapeId was deprecated in MediaWiki 1.30. [Called from pivotTemplate::renderSidebar in www\dev.seite.de\skins\pivot\Pivot.skin.php at line 306]

Backtrace:

  • GlobalFunctions.php line 1029 calls MWDebug::deprecated()
  • Sanitizer.php line 1086 calls wfDeprecated()
  • Pivot.skin.php line 306 calls Sanitizer::escapeId()
  • Pivot.skin.php line 128 calls pivotTemplate->renderSidebar()
  • SkinTemplate.php line 129 calls pivotTemplate->execute()
  • SkinTemplate.php line 144 calls SkinTemplate->generateHTML()
  • OutputPage.php line 2615 calls SkinTemplate->outputPage()
  • MediaWiki.php line 947 calls OutputPage->output()
  • MediaWiki.php line 960 calls MediaWiki->{closure}()
  • MediaWiki.php line 543 calls MediaWiki->main()
  • index.php line 53 calls MediaWiki->run()
  • index.php line 46 calls wfIndexMain()
Moins de (talkcontribs)

if i change the skin to vector there is onliny one line in the console "MWDebug output complete", without any errors. but tinymce still doesnt work.


if i try the it with "action=tinymceedit" the editor loads, but stops automaticly at some debug points

DuncanCrane (talkcontribs)

That's great, thanks Niko

Just a thought. In your preferences, would you disable the 'Activate the edit toolbar' option there and save. Would you then try to load the editor from a red link or other edit link?

Moins de (talkcontribs)

Good morning, ehm I will unfortunately not find what I am looking for.  Neither with the 1to1 translation nor if I look for similar points.

Could you give me a hint where exactly the point is to be found?

Thanks

DuncanCrane (talkcontribs)

Hi Niko

Of course. BTW you have done brilliantly with the comms. I'd really struggle doing this in a different language (except maybe if it was javascript :-) )

If you go into your personal preferences on the 'Editing' tab you have several options. The option I want you to deselect is the last under the 'Editor' heading. This has a label 'Enable the editing toolbar. This is sometimes called the "2010 wikitext editor". This option should be cleared. I tried changing my wiki language but it seems this screen is still in English. So my apologies I can't give you a localised version but hopefully this capture will make it clearer? Here is the screen which shows the item selected. Once cleared the tick in the box should be a blank instead of course.

Edit preferences
Moins de (talkcontribs)

hehe many thanks for the praise (: one likes to hear that!

unfortunately my site looks a bit different and i don't have this point at all? do you know what could be the reason for that?


unfortunately the picture upload still does not work for me... so here:

https://ibb.co/N9ymNcW


thanks for your great support!

DuncanCrane (talkcontribs)

Hi Niko

I am stupid! I had Google set to automatically translate German to English!!

I think what may have happened is that you disabled VisualEditor and the WikiText editor in LocalSettings.php something like this:

#wfLoadExtension( 'VisualEditor' );
#wfLoadExtension( 'WikiEditor' );

I'm sorry i I gave the impression you should do this in LocalSettings.php, I meant for you to do it in the preferences screen (see below). If I am right, would you re-enable the two extensions in LocalSettings.php by removing the '#' at the start of each line? You should then see the options below in the 'Bearbeiten' tab in your preferences. If you do, would you deselect options 4 and 6 under the heading 'Bearbeitungsprogramme'?

If you then select a link to edit, would you let me know what happens?

Editor preferences
Moins de (talkcontribs)

aaahhh okay (: now have the option. Now I have selected all checkboxes like on your screenshot.

Unfortunately nothing changes in the behavior. When I click on Edit, I still get the simple standard editor displayed :(

DuncanCrane (talkcontribs)

Great, thanks Niko. Would you deselect the option 'Bearbeiten-Werkzeugleiste aktivieren' and try again?

Moins de (talkcontribs)

Sorry, I said it stupidly... I set everything up like you suggested.

including disabling "Enable Edit Toolbar"

Currently it looks like this:

https://ibb.co/4YVHwpz

DuncanCrane (talkcontribs)

Easily done, Niko :-)

How confident are you with making changes to code?

What I'd like you to do next is make a small and temporary change to the file TinyMCEActions.php in the root folder of the extension.

Right after the lines at line number 51, which are:

    static function displayTabAndModifyAddTopicLink( $obj, &$links ) {
		global $wgRequest;
		global $wgTinyMCEUse;

I'd like you to insert the following lines and then save the file:

MWDebug::init();
$txt = "\nLinks in TinyMCEAction\n";
MWDebug::log($txt);
$txt = print_r($links, true); 
MWDebug::log($txt);

Assuming you still have the lines to invoke debugging in your LocalSettings.php which we talked about above:

$wgDebugToolbar = true;
$wgShowExceptionDetails = true;
error_reporting( -1 );
ini_set( 'display_errors', 1 );

If you then load any page for viewing you will get two additional entries in the mediawiki debug console with the label 'log' on the left. Would you copy those and send them to me?

Moins de (talkcontribs)

here wo go (:

Log Links in TinyMCEAction TinyMCEAction::displayTabAndModifyAddTopicLink
Log Array ( [namespaces] => Array ( [main] => Array ( [class] => selected [text] => Seite [href] => /index.php?title=Testseite [exists] => 1 [primary] => 1 [context] => subject ) [talk] => Array ( [class] => new [text] => Diskussion [href] => /index.php?title=Diskussion:Testseite&action=edit&redlink=1 [exists] => [primary] => 1 [context] => talk ) ) [views] => Array ( [view] => Array ( [class] => selected [text] => Lesen [href] => /index.php?title=Testseite [exists] => 1 [primary] => 1 [redundant] => 1 ) [edit] => Array ( [class] => [text] => Bearbeiten [href] => /index.php?title=Testseite&action=edit [primary] => 1 ) [history] => Array ( [class] => [text] => Versionsgeschichte [href] => /index.php?title=Testseite&action=history ) [unwatch] => Array ( [class] => icon mw-watchlink [text] => Nicht mehr beobachten [href] => /index.php?title=Testseite&action=unwatch [data] => Array ( [mw] => interface ) ) ) [actions] => Array ( [delete] => Array ( [class] => [text] => Löschen [href] => /index.php?title=Testseite&action=delete ) [move] => Array ( [class] => [text] => Verschieben [href] => /index.php?title=Spezial:Verschieben/Testseite ) [protect] => Array ( [class] => [text] => Schützen [href] => /index.php?title=Testseite&action=protect ) ) [variants] => Array ( ) ) TinyMCEAction::displayTabAndModifyAddTopicLink
Log Links in TinyMCEAction TinyMCEAction::displayTabAndModifyAddTopicLink
Log Array ( [namespaces] => Array ( [main] => Array ( [class] => selected [text] => Seite [href] => /index.php?title=Testseite [exists] => 1 [primary] => 1 [context] => subject ) [talk] => Array ( [class] => new [text] => Diskussion [href] => /index.php?title=Diskussion:Testseite&action=edit&redlink=1 [exists] => [primary] => 1 [context] => talk ) ) [views] => Array ( [view] => Array ( [class] => selected [text] => Lesen [href] => /index.php?title=Testseite [exists] => 1 [primary] => 1 [redundant] => 1 ) [edit] => Array ( [class] => [text] => Bearbeiten [href] => /index.php?title=Testseite&action=edit [primary] => 1 ) [history] => Array ( [class] => [text] => Versionsgeschichte [href] => /index.php?title=Testseite&action=history ) [unwatch] => Array ( [class] => icon mw-watchlink [text] => Nicht mehr beobachten [href] => /index.php?title=Testseite&action=unwatch [data] => Array ( [mw] => interface ) ) ) [actions] => Array ( [delete] => Array ( [class] => [text] => Löschen [href] => /index.php?title=Testseite&action=delete ) [move] => Array ( [class] => [text] => Verschieben [href] => /index.php?title=Spezial:Verschieben/Testseite ) [protect] => Array ( [class] => [text] => Schützen [href] => /index.php?title=Testseite&action=protect ) ) [variants] => Array ( ) ) TinyMCEAction::displayTabAndModifyAddTopicLink
Log MWDebug output complete MWDebug::getDebugHTML
DuncanCrane (talkcontribs)

Hi Niko

Sorry, I had to go out for a bit. Thanks for that.

So the good news is that the programme is running and we can dumpt stuff to the debugger. It is a bit odd though that we are getting the output twice but never mind for now.

Without removing the original change, would you now put the same fives lines just before the return statement at the end of the TinyMCEActions.php file, also adding a '1' to the 'Links' text as follows:

MWDebug::init();
$txt = "\nLinks 1 in TinyMCEAction\n";
MWDebug::log($txt);
$txt = print_r($links, true); 
MWDebug::log($txt);

The return statement is something like:

return true; // always return true, in order not to stop MW's hook processing!

Would you then reload the page and send me the 'log' output displayed.

We may have to do this a few times to isolate the problem.

2A02:8070:E186:4300:1CAB:C5D1:B734:4A7B (talkcontribs)

good morning DuncanCrane,


thanks for your help (:

Log Links in TinyMCEAction TinyMCEAction::displayTabAndModifyAddTopicLink
Log Array ( [namespaces] => Array ( [main] => Array ( [class] => selected [text] => Hauptseite [href] => /index.php?title=Hauptseite [exists] => 1 [primary] => 1 [context] => subject ) [talk] => Array ( [class] => new [text] => Diskussion [href] => /index.php?title=Diskussion:Hauptseite&action=edit&redlink=1 [exists] => [primary] => 1 [context] => talk ) ) [views] => Array ( [view] => Array ( [class] => selected [text] => Lesen [href] => /index.php?title=Hauptseite [exists] => 1 [primary] => 1 [redundant] => 1 ) [edit] => Array ( [class] => [text] => Bearbeiten [href] => /index.php?title=Hauptseite&action=edit [primary] => 1 ) [history] => Array ( [class] => [text] => Versionsgeschichte [href] => /index.php?title=Hauptseite&action=history ) [unwatch] => Array ( [class] => icon mw-watchlink [text] => Nicht mehr beobachten [href] => /index.php?title=Hauptseite&action=unwatch [data] => Array ( [mw] => interface ) ) ) [actions] => Array ( [delete] => Array ( [class] => [text] => Löschen [href] => /index.php?title=Hauptseite&action=delete ) [move] => Array ( [class] => [text] => Verschieben [href] => /index.php?title=Spezial:Verschieben/Hauptseite ) [protect] => Array ( [class] => [text] => Schützen [href] => /index.php?title=Hauptseite&action=protect ) ) [variants] => Array ( ) ) TinyMCEAction::displayTabAndModifyAddTopicLink
Log Links 1 in TinyMCEAction TinyMCEAction::displayTabAndModifyAddTopicLink
Log Array ( [namespaces] => Array ( [main] => Array ( [class] => selected [text] => Hauptseite [href] => /index.php?title=Hauptseite [exists] => 1 [primary] => 1 [context] => subject ) [talk] => Array ( [class] => new [text] => Diskussion [href] => /index.php?title=Diskussion:Hauptseite&action=tinymceedit&redlink=1 [exists] => [primary] => 1 [context] => talk ) ) [views] => Array ( [view] => Array ( [class] => selected [text] => Lesen [href] => /index.php?title=Hauptseite [exists] => 1 [primary] => 1 [redundant] => 1 ) [tinymceedit] => Array ( [class] => [text] => Bearbeiten [href] => /index.php?title=Hauptseite&action=tinymceedit ) [edit] => Array ( [class] => [text] => Edit source [href] => /index.php?title=Hauptseite&action=edit [primary] => 1 ) [history] => Array ( [class] => [text] => Versionsgeschichte [href] => /index.php?title=Hauptseite&action=history ) [unwatch] => Array ( [class] => icon mw-watchlink [text] => Nicht mehr beobachten [href] => /index.php?title=Hauptseite&action=unwatch [data] => Array ( [mw] => interface ) ) ) [actions] => Array ( [delete] => Array ( [class] => [text] => Löschen [href] => /index.php?title=Hauptseite&action=delete ) [move] => Array ( [class] => [text] => Verschieben [href] => /index.php?title=Spezial:Verschieben/Hauptseite ) [protect] => Array ( [class] => [text] => Schützen [href] => /index.php?title=Hauptseite&action=protect ) ) [variants] => Array ( ) ) TinyMCEAction::displayTabAndModifyAddTopicLink
Log Links in TinyMCEAction TinyMCEAction::displayTabAndModifyAddTopicLink
Log Array ( [namespaces] => Array ( [main] => Array ( [class] => selected [text] => Hauptseite [href] => /index.php?title=Hauptseite [exists] => 1 [primary] => 1 [context] => subject ) [talk] => Array ( [class] => new [text] => Diskussion [href] => /index.php?title=Diskussion:Hauptseite&action=edit&redlink=1 [exists] => [primary] => 1 [context] => talk ) ) [views] => Array ( [view] => Array ( [class] => selected [text] => Lesen [href] => /index.php?title=Hauptseite [exists] => 1 [primary] => 1 [redundant] => 1 ) [edit] => Array ( [class] => [text] => Bearbeiten [href] => /index.php?title=Hauptseite&action=edit [primary] => 1 ) [history] => Array ( [class] => [text] => Versionsgeschichte [href] => /index.php?title=Hauptseite&action=history ) [unwatch] => Array ( [class] => icon mw-watchlink [text] => Nicht mehr beobachten [href] => /index.php?title=Hauptseite&action=unwatch [data] => Array ( [mw] => interface ) ) ) [actions] => Array ( [delete] => Array ( [class] => [text] => Löschen [href] => /index.php?title=Hauptseite&action=delete ) [move] => Array ( [class] => [text] => Verschieben [href] => /index.php?title=Spezial:Verschieben/Hauptseite ) [protect] => Array ( [class] => [text] => Schützen [href] => /index.php?title=Hauptseite&action=protect ) ) [variants] => Array ( ) ) TinyMCEAction::displayTabAndModifyAddTopicLink
Log Links 1 in TinyMCEAction TinyMCEAction::displayTabAndModifyAddTopicLink
Log Array ( [namespaces] => Array ( [main] => Array ( [class] => selected [text] => Hauptseite [href] => /index.php?title=Hauptseite [exists] => 1 [primary] => 1 [context] => subject ) [talk] => Array ( [class] => new [text] => Diskussion [href] => /index.php?title=Diskussion:Hauptseite&action=tinymceedit&redlink=1 [exists] => [primary] => 1 [context] => talk ) ) [views] => Array ( [view] => Array ( [class] => selected [text] => Lesen [href] => /index.php?title=Hauptseite [exists] => 1 [primary] => 1 [redundant] => 1 ) [tinymceedit] => Array ( [class] => [text] => Bearbeiten [href] => /index.php?title=Hauptseite&action=tinymceedit ) [edit] => Array ( [class] => [text] => Edit source [href] => /index.php?title=Hauptseite&action=edit [primary] => 1 ) [history] => Array ( [class] => [text] => Versionsgeschichte [href] => /index.php?title=Hauptseite&action=history ) [unwatch] => Array ( [class] => icon mw-watchlink [text] => Nicht mehr beobachten [href] => /index.php?title=Hauptseite&action=unwatch [data] => Array ( [mw] => interface ) ) ) [actions] => Array ( [delete] => Array ( [class] => [text] => Löschen [href] => /index.php?title=Hauptseite&action=delete ) [move] => Array ( [class] => [text] => Verschieben [href] => /index.php?title=Spezial:Verschieben/Hauptseite ) [protect] => Array ( [class] => [text] => Schützen [href] => /index.php?title=Hauptseite&action=protect ) ) [variants] => Array ( ) ) TinyMCEAction::displayTabAndModifyAddTopicLink
Log MWDebug output complete MWDebug::getDebugHTML
DuncanCrane (talkcontribs)

Hi Niko

Thank you too for persevering and trying to get this to work :-)

Ok, now this is strange. The fact you get the 'Link 1' log entry shows that TinyMCE editor has passed the various tests necessary to edit a page. Also, if you look at the 'Link 1' log entry, the 'Diskussion' and 'Bearbeiten' links both have 'action=timymceedit'. When you hover over the name of these tabs on your wiki page, you should see that the link text is the same as the href here.

As this doesn't seem to be so, it must mean something else in your configuration is overriding these settings before the page is output to your browser.

This means we have to find out what is causing this by a process of elimination. Would you go to the 'special' 'version' page on your wiki and take an image of it and send it to me so I can see everything that is loaded and the versions? Sorry, it may require a few images to get everything.

Moins de (talkcontribs)

hmmm that's strange. when i click on "edit" it looks like this: https://ibb.co/fprfpwh

here is the version page: https://ibb.co/0t2BFh7

DuncanCrane (talkcontribs)

Hi Niko

The 'edit' you are hovering over is a 'section' edit link. This should also have a 'tinymceedit' action too but we can come back to that. The two links I'm interested in for now are the 'Discussion' and 'Edit' links in the pivot 'Actions' menu and what they show when you hover over them?

Your 'versions' page looks OK. I've disabled everything in mine so it looks like yours, but I still get the TinyMCE editor! Oh dear!!!

One other question? Did you apply the WikiEditor patch as described here

Moins de (talkcontribs)

sorry, I won't be able to test it until next week.

Thanks for your help and have a nice weekend

DuncanCrane (talkcontribs)

Hey, no problem :-)

Have a good one too

2A02:8070:E186:4300:D414:731C:33F:AE7A (talkcontribs)

good morning (:


the actions via "discussion" and via "edit" in the action menu look good (:

There the TinyMCEditor is opened and loads without debug stops ((:


I just executed the fix for the WIKIEditor.


Now only the normal "edit" button is missing.


Thanks

DuncanCrane (talkcontribs)

Hi Niko Sounds like we are making some progress:-) Is it possible to do a screen capture of where the normal 'edit' button is missing, just so I'm sure I understand? Many thanks Duncan

Moins de (talkcontribs)

yep, things are definitely starting to look better (:

I hope it is understandable this way

https://ibb.co/WfFV19Q

DuncanCrane (talkcontribs)

Great, thanks Niko

I found why that link wasn't displaying.

I have now made a fix and uploaded it to my development GitHub master branch located here https://github.com/duncan-crane/TinyMCE

If you download this branch it has a number of other small bug fixes:-) These will be uploaded to the mediawiki Gerrit repository in the next maintenance release but if you'd like them straight away then please download from the development site on GitHub.

Hopefully everything is good now but do let me know if you have any more problems.

Thank you for perservering too :-)

Moins de (talkcontribs)

Good morning,

wuhoo! It looks good!

Thanks for your great support

Niko

DuncanCrane (talkcontribs)

Your welcome - hope you enjoy using TinyMCE :-)

TinyMCE - If i click image properties --- i get this....

2
Stuttgarter2006 (talkcontribs)
TinyMCE

If i click image properties

DuncanCrane (talkcontribs)

Hi again Stuttgarter2006 and thank you for drawing this to my attention. It appears from the screen image that there is no entry in the 'source' field of the dialog. If you try to select the 'image properties' tab of the dialog this is not possible without a 'source' file being provided first. That is why this message is displayed.

However, when I tested the problem you identified before, if one tries to 'ok' the upload of a file when the 'source' field is empty, one also gets this message. This is a bug so I'll have a look at fixing this.

Many thanks, Duncan

Reply to "TinyMCE - If i click image properties --- i get this...."

Upload and display file - Problem with TinyMCE

2
Stuttgarter2006 (talkcontribs)

Problem with TinyMCE // mediawiki-1.37.1, -- PHP8.0

If i want to use a file from the server it show me no files from the Server... but i have got files inside the /images/...?!

Tiny MCE
DuncanCrane (talkcontribs)

Hi Stuttgarter2006

Thanks for trying the TinyMCE extension. Currently, if you select the 'file in this wiki' option, you have to provide the name of the page which points to the file. For example if the wiki page of the image is 'File:picturexyz.jpg' then the entry to the 'Source' field should be 'picturexyz.jpg'. The upload facility doesn't allow browsing of the images stored in the wiki in the current version, although this could be added as a feature in future. The reason this hasn't be done so far is that wiki's frequently have many thousands of images, often without meaningful names, so it can be quite a resource hungry process to locate an existing image by browsing, unless one has been very disciplined when storing them in the first place!

Thanks, Duncan

Reply to "Upload and display file - Problem with TinyMCE"
Activede (talkcontribs)

Is there a way to customize the keyboard shortcuts in TinyMCE?

DuncanCrane (talkcontribs)

Hi Activede, thank you for using the TinyMCE extension. Currently the shortcuts are hard coded either in the TinyMCE extension or the TinyMCE core code. I think it would be possible to create some configuration variables to over-ride these but it would require some coding. Also, many of them are standards used in Windows and Apple IOS operating systems. If you let me know which specifically you'd like to change, I may be able to do something if it's not too many?

Thanks, Duncan

Activede (talkcontribs)

Hi Duncan, thanks for your reply. I actually just want to set "tab" and "shift+tab" for indent and outdent. Do you know which lines to change for that?

DuncanCrane (talkcontribs)

Hi Activede

It may be possible to make changes to the 'mw_wikinonbreaking' custom plugin to do that. This plugin already allows 'ctrl' + 'shift' + 'tab' to insert a pseudo tab into the editor content. There are potentially some drawbacks, as 'tab' characters have a specific meaning within tables and lists (see https://www.tiny.cloud/docs/plugins/opensource/nonbreaking/#nonbreaking_force_tab)

The code would need to trap when the insert point is inside either of these constructs and allow the 'tab' character to be processed by the 'lists' or 'tables' plugins as normal. Also, there would need to be a custom configuration variable to switch this tab behaviour on and off, as not every user would want it. The default should probably be 'off'. There are already standard TinyMCE commands for 'Indent' and 'Outdent'. So the code would: test for a 'tab' or 'shift' + 'tab'; if true, test for not in a 'list' or 'table'; if true, fire 'Indent' or 'Outdent' as appropriate.

I could probably do this over the next week or so for you, or I'm happy to provide some support/QA if you'd like to try it yourself? Let me know?

Thanks, Duncan

Activede (talkcontribs)

Hi Duncan,

thanks for your reply. The main reason for me using TinyMCE instead of VisualEditor is, that I need to indent and outdent standard paragraphs. VisualEditor only allows to indent list items, which doesn't help in this case. Wikitext of course has a comfortable solution with just using ":" or "::" for two "tabs", but the audience of this page probably doesn't want to learn wikitext.

Every single wiki page will presumably have the following structure

A. First point to mention
And some text here. Probably a few paragraphs.
I. Some text here
and some here
  • With some bullets
  • And another one
1. Some text here
2. Some text here
a) And some text here
b) and some here
aa) and some here
bb) and here
(1) And so on
(2) And
II. So

B. Forth

So it is going to be such a massive list, that using <ul> and <ol> could become very difficult to set up, so I decided to do that manually. However, always clicking the indent / outdent button in TinyMCE would become very tiring when writing on that page. As I will have tables disabled anyways it doesn't matter for me if there would be any conflicts. So that is the plan. ;-) Your solution would just add some &nbsp;-elements if I got that right? That's not really what I need. I need TinyMCE to put a ":" when pressing the "tab"-key. Although I also don't mind to provide a different shortcut if that would cause less problems.

DuncanCrane (talkcontribs)

Hi Activede,

Not quite. In my suggestion, using 'tab' and 'shift' + 'tab' would fire the native TinyMCE 'Indent' and 'Outdent' events. Using the TinyMCE Indent and Outdent events is equivalent to using ':' in wiki text. The TinyMCE extension already translates the presence of 'indents' and 'outdents' in the editor back to the ':' wiki markup, for example if you use the 'Indent' or 'Outdent' menu buttons in the TinyMCE editor.

Using a different short cut would simplify matters, as it wouldn't conflict with the processing of lists and tables by TinyMCE. As mentioned, it would be possible to trap these cases and process them appropriately, just more complicated. However, time is precious, so if you'd like to propose a different shortcut (which isn't already in use) that would make things simpler for me :-)

I do have a question relating to your example above, which I am not sure I understood fully. Is it when you have a paragraph within a list where you want to use the indent (eg the 'and some here' in point 'I' of your example)? In which case using 'shift' + 'return' within the bullet point in the TinyMCE editor would visually achieve this. Using a ':' in a list at this point in the wiki markup, I think, will have a slightly different result. Perhaps you could give the wiki markup for the example as well, if this is the use case that is important?

Many thanks

Duncan

Activede (talkcontribs)

Hi Duncan, sorry for the late reply. The wiki is a hobby project and I had some stuff to do for work. The "and some here" could either be achieved by pressing shift+return or by pressing return and then indenting independently. I have not thought about the differences to be honest. Important is that indent and outdent work smoothly via a convenient shortcut.

DuncanCrane (talkcontribs)

Hi Activede, in which case what short cut would you want to use in preference to 'tab' and 'shift tab', because they already have an application in lists and tables?

Activede (talkcontribs)

Hi Duncan, Word on Mac uses opt+tab as soon as you enter a table. That makes sense to me. What do you think?

Reply to "Customize keyboard shortcuts"

Change default Image & Link parameters

4
Summary by DuncanCrane

User updated work-around so it now works :-)

Calebfergie (talkcontribs)

Hi there,

I was wondering if it's possible to change the default parameters from images and links?

At least for the TinyMCE editor in my wiki, when I click the 🖻 upload/edit file icon, the parameters in the image tab default to:

Vertical alignment: Middle

Horizontal alignment: Right

Format: Thumb


Similarly for 🔗linking, the default parameter is type: external


I would prefer different defaults for these - could anyone recommend a way to change them? Is it something in TinyMCE, or maybe a $wgDefault-style command I could use in LocalSettings.php?


I'm new to wiki/php so let me know if you need some other info. Thanks!

DuncanCrane (talkcontribs)

Hi Calebfergie

Sorry for the delay in replying and thank you for using the TinyMCE Extension and raising this query.

Unfortunately these defaults are set in the code. I think I could add some settings for this into LocalSettings though. Currently I'm working on a new version with quite a few enhancements so my preference would be to add this to the new version if that's OK/

In the meantime, if you you are happy to edit the code, for the upload these settings are in:

'function displayForm(dialogData)' on line 363 of .../extensions/TinyMCE/tinymce/plugins/mw_upload/plugin.js

To change the default of the linking to 'internal' first rather than 'external' you can reverse the entries in:

array 'link_class_list:' on line 66 of .../extensions/TinyMCE/MW_tinymce.js

Hopefully that will be OK for now. Do let me know if you've any other suggestions DuncanCrane (talk) 09:21, 20 June 2019 (UTC)

Activede (talkcontribs)

Apparently that workaround doesn't work anymore. But changing order on

line 145 in .../extensions/TinyMCE/custom_plugins/mediawiki/plugins/mw_wikilink/plugin.js works.

DuncanCrane (talkcontribs)

Thanks Activede, I'll check that out and update. Duncan

Depricated Hook After Upgrading to MediaWiki 1.37.1

5
Summary by DuncanCrane

Problem caused by php warning errors not being handled correctly in the set up of the wiki. See detail for how to avoid this.

74.136.16.180 (talkcontribs)

Hello, I'm not sure which version I was using before, but I just upgraded to 1.37.1 and upgraded the TinyMCE extension. When I try to edit a page with TinyMCE I get


Deprecated</b>: Use of EditPageBeforeEditToolbar hook (used in TinyMCEHooks::removeDefaultToolbar) was deprecated in MediaWiki 1.36. [Called from MediaWiki\HookContainer\HookContainer::run in /directory/public/includes/HookContainer/HookContainer.php at line 137] in <b>/directory/public/includes/debug/MWDebug.php</b> on line <b>375


Any suggestions?

DuncanCrane (talkcontribs)

Hi, would you let me know the version of the TinyMCE extension you are using? The maintenance policy for the TinyMCE extension is 'master' so the master branch on Gerrit is the one to use. If you check the version number for TinyMCE on the 'version' special page on your wiki, what does it say? Many thanks Duncan

74.136.16.180 (talkcontribs)

Hi, I went ahead and did


git clone "h...://gerrit.wikimedia.org/r/mediawiki/extensions/TinyMCE" (modified this because it was saying linkspam warning on mediawiki.org submission box)


and my version shows as 1.1.2 (f9abe09) 08:38, 30 December 2021.


I am still getting the same error. Thank you for your help.

Activede (talkcontribs)

Hello, I've got the same problem. After moving to a stronger server – with probably some different software running – TinyMCE stopped working. The Toolbar doesn't show up at all and if you activate PHP-Errors I do get the same error.

Update: Also occurs using mediawiki 1.37.0 Update: Apparently the issue is already solved when php errors are deactivated. Clear browser cache afterwards and that worked for me.

DuncanCrane (talkcontribs)

Thank you both for the responses. The deprecation message is, I believe, a warning message. Although the code is deprecated, it hasn't been removed from the Mediawiki core (https://www.mediawiki.org/wiki/Manual:Hooks/EditPageBeforeEditToolbar). The reason it still exists in the TinyMCE extension is to maintain backward compatibility with Mediawiki version 1.35, which is the current long term stable version, and still widely in use. It appears that the problem is being caused by the Mediawiki system reporting the warning when PHP errors are activated, rather than the the existence of the deprecated code itself in the TinyMCE extension.

It seems that, when Mediawiki outputs an error message, the page output is no longer in standards mode (https://www.tiny.cloud/blog/tinymce-requires-standards-mode/). This is potentially a bug in Mediawiki as, without error reporting, Mediawiki does output pages in standards mode, as Activede points out. This might be considered as a bug in Mediawiki not trapping and handling php warning error messages in a way that allows execution to proceed, although there are ways to debug mediawiki that might allow this (https://www.mediawiki.org/wiki/Manual:How_to_debug) by using a log file for error messages. Alternatively you could use the following in local settings, which means only fatal php error will be output to the browser page (note the +ve '1' not -ve as in the Mediawiki documentation:

error_reporting( 1 )

I hope this works for you but, if not, please let me know.

Summary by DuncanCrane

User solved this (see detail)

Activede (talkcontribs)

This is how I tried to set up my toolbar with a customized test template. However, the button appears but tells that no templates were found. Any ideas?

$wgTinyMCESettings = array(	

"#wpTextbox1" => array (
"toolbar" => 'undo redo | formatselect | outdent indent | bold italic underline | bullist numlist advlist | wikilink wikiunlink table | reference template wikitext'				
),  

"TinyMCETemplates" => array(
       array(
           "title" => 'Test-Template',
           "description" => 'Test-Template',
           "content" => 'Test-Template'
       ),
   ),
);

Update: Got it.

$wgTinyMCESettings = array(
    "#wpTextbox1" => array (

        "toolbar" => 'undo redo | formatselect | outdent indent | bold italic underline | bullist numlist advlist | wikilink wikiunlink table | reference template wikitext',

        "tinyMCETemplates" => array(
            array(
                'title' => 'Test-Template',
                'description' => 'Test-Template',
                'content' => 'Test-Template'
            ),
        )
    ),
);

After Upgrading of TinyMCE it is not working with PageForms

6
Summary by DuncanCrane

Resolved in version 1.1.2

Tsch42 (talkcontribs)

After Upgrading from TinyMCE 0.3 to 1.1 it is not longer working with PageForms

MW: 1.31.7

PageForms: 5.2.1

TinyMCE: 1.1 (7c1a5d9)08:37, 2 August 2021


TinyMCE is no longer loading in editor=tinymce forms.


there is a second problem. If TinyMCE loads on "edit" pages. there are errors about "Failed to initialize plugin: anchor". this error is repeated for: autosave, charmap, insertdatetime, preview, save, searchreplace, visualblocks

Lost Student (talkcontribs)

I'm seeing similar problems in the following setup:

Mediawiki 1.35.3

PageForms 4.9.5

TinyMCE 1.1


On any forms where the free text specifies editor=tinymce, the text area opens as a plain text input box with no toolbars, and the text showing raw wikitext markup.

This problem is not present in an older setup with the following versions:

MediaWiki 1.33.0

Page Forms 4.9

TinyMCE 0.3


Since I have no idea if the problem lies with TinyMCE or PageForms, I'll post something on the other extension talk page as well.

DuncanCrane (talkcontribs)

Hi Tsch42 and Lost Student - apologies for the delay in responding. I'll look into these and respond soon. Many thanks, Duncan

Lost Student (talkcontribs)

No problem! I appreciate you looking into it. Please let me know if there's any additional info that would be helpful.

FYI I looked at the browser console when loading the page and no errors popped up.

DuncanCrane (talkcontribs)

Hi, Sorry it took a while again. I've uploaded some changes to the master copy which should fix this. Many thanks Duncan

Lost Student (talkcontribs)

No worries, thank you! I will install sometime this week and let you know if it worked.