• Briefly, the problem was that when you have more than one tinyMCE editor in the post editing window, clicking a language switching tab would clear the contents of the editor. This was the case only in Visual (tinyMCE) mode.

    I dug into the problem.

    When switching a language tab, mqTranslate javascript calls TinyMCE.triggerSave(), which triggers qtrans_hook_on_tinyMCE, which in turn calls qtrans_save(e.content) for ALL TinyMCE editors.

    qtrans_save puts the contents of the last TinyMCE editor processed in the #content textarea, which is later read by switchEditors.go when updating the current value of the tinyMCE editor (to the language that was just selected).

    How I fixed it manually was change one line in qtrans_hook_on_tinyMCE like this:
    if (!ed.isHidden()) => if (ed.id == 'qtrans_textarea_content' && !ed.isHidden())

    An alternative solution would be to call editor.save() for the relevant editor instead of calling tinyMCE.triggerSave() that saves all editors.

    Let me know if you need extra info.

    https://ww.wp.xz.cn/plugins/mqtranslate/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Broken with multiple TinyMCE ( patch idea)’ is closed to new replies.