WordPress.org

Forums

mqTranslate
[resolved] Cannot set property 'elements' of undefined | qtrans_updateTinyMCE (8 posts)

  1. acub
    Member
    Posted 1 year ago #

    I've replaced qtranslate with mqtranslate on multiple websites without problems and they all work with 3.9. However, there's one that gives me an error in page edit screen. I have already tried disabling all plugins except mqtranslate, and changing theme to twenty-forteen but the problem persists.

    The error I get is "Uncaught TypeError: Cannot set property 'elements' of undefined " and it happens in the qtrans_updateTinyMCE function from mqtranslate_javascript.php

    Any ideas on how to fix this?

    Thank you for your time and effort.

    https://wordpress.org/plugins/mqtranslate/

  2. chsxf
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    The error you are reporting is somewhat surprising because it would mean TinyMCE is not pre-configured by WordPress at the time our function tries to update it.
    This is unlikely and not really easy to track unfortunately...

  3. acub
    Member
    Posted 1 year ago #

    With all plugins disabled, twenty-fourteen active and browser cache manually cleared I do not see visual/text tabs on page and posts edit screen. So I guess that's why mqTranslate cannot find TinyMCE.

    For now I've just downgraded that particular website and I hope some future WP release will fix this.

    I'll mark this resolved, as it doesn't seem to be directly related with mqTranslate, it's just a symptom of another problem.

  4. chsxf
    Member
    Plugin Author

    Posted 1 year ago #

    Are you sure that in your user profile you have not checked "Disable the visual editor when writing"?

  5. acub
    Member
    Posted 1 year ago #

    Funny. And a bit embarrassing.

    Short answer: that was the cause.

    Longer one: at the owner's request I've made a function that was disabling the "disable visual editor" from user profile and also made a custom function that was specifically setting "Disable visual editor" to true upon saving user profile. This was like 3 years ago and I completely forgot about it.

    When I reverted to twenty-fourteen I never checked the user profile, only the page edit screen.

    Thank you.

    :)
    _______________

    On a sidenote, I'd like to further express my gratitude for this fork of qtranslate and let you know that if you need a Romanian translator for .po/.mo files of your current and future plugins I am here.

  6. chsxf
    Member
    Plugin Author

    Posted 1 year ago #

    We would be very pleased if you would like to provide this translate for mqTranslate. You can start from the original qTranslate Romanian .po file and ask PoEdit (or your translation software) to reparse mqTranslate files. Some texts remain the same between the two plugins.

  7. chsxf
    Member
    Plugin Author

    Posted 1 year ago #

    However, your story leads me indeed to a bug where mqTranslate tries to set up TinyMCE even if it is not enabled. I need to check this out.

  8. geoff3
    Member
    Posted 1 year ago #

    chsxf, you have just fixed my problem too.
    Don't know if you are aware of it but checking the "Disable the visual editor when writing" also prevents the dual language title from appearing when adding posts, and displays text in both languages when editing a post.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • mqTranslate
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic