Title: Broken with multiple TinyMCE ( patch idea)
Last modified: August 22, 2016

---

# Broken with multiple TinyMCE ( patch idea)

 *  [naktinis](https://wordpress.org/support/users/naktinis/)
 * (@naktinis)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/broken-with-multiple-tinymce-patch-idea/)
 * 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://wordpress.org/plugins/mqtranslate/](https://wordpress.org/plugins/mqtranslate/)

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

 *  Thread Starter [naktinis](https://wordpress.org/support/users/naktinis/)
 * (@naktinis)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/broken-with-multiple-tinymce-patch-idea/#post-5405099)
 * Could someone with access to mqTranslate repository look into this, please? It
   should be a relatively simple fix that really makes sense.
 *  [leslierad](https://wordpress.org/support/users/leslierad/)
 * (@leslierad)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/broken-with-multiple-tinymce-patch-idea/#post-5405104)
 * Hi Naktinis,
 * Not sure if you saw this:
    [https://github.com/xhaleera/mqtranslate](https://github.com/xhaleera/mqtranslate)
 * you could submit your changes there, they would be noticed and eventually integrated
   if proven a solution.

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

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

 * ![](https://s.w.org/plugins/geopattern-icon/mqtranslate_b2b2b2.svg)
 * [mqTranslate](https://wordpress.org/plugins/mqtranslate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mqtranslate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mqtranslate/)
 * [Active Topics](https://wordpress.org/support/plugin/mqtranslate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mqtranslate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mqtranslate/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [leslierad](https://wordpress.org/support/users/leslierad/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/broken-with-multiple-tinymce-patch-idea/#post-5405104)
 * Status: not resolved