Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have installed qtranslate on my wordpress site, it all works fine, but sometimes the content editor does not show the text, When I force refresh the page a few times (Ctrl + r) eventually the text shows up.

I was going to put images here to explain it but, this post already has the images I would put on, (however the questions differ) qtranslate is not working properly

I have deactivated all of the plugins, and this problem it's still there, I have tried alot of other things to

Error:

Uncaught TypeError: Cannot set property 'setup' of undefined
Line: 303, qtranslate_javascript.php

$q_config['js']['qtrans_hook_on_tinyMCE'] = "
qtrans_hook_on_tinyMCE = function(id) {

tinyMCEPreInit.mceInit[id].setup = function(ed) {
    ed.onSaveContent.add(function(ed, o) {
        if (!ed.isHidden())  {
            qtrans_save(switchEditors.pre_wpautop(o.content));
        }
    });
};
ed = new tinymce.Editor(id, tinyMCEPreInit.mceInit[id]);
    ed.render();
}
";

Console Logging ID:

qtrans_textarea_content post.php:467
qtrans_textarea_acf_settings 

Other notes

I have also tried to add the try{} catch(e){} to avoid the script from breaking down, it does not seem to help at all, I have run out of options and I really need some help with this

Cheers

share|improve this question

closed as off-topic by Mark Kaplun, Johannes Pille, birgire, Pieter Goosen, ialocin Oct 5 at 19:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – Mark Kaplun, Johannes Pille, birgire, Pieter Goosen, ialocin
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

I have found a great post which solves this issue,

http://wordpress.org/support/topic/plugin-qtranslate-problems-displaying-in-the-edit?replies=21#post-3160564

The issue is on qtranslate_javascript.php line 225

Replace

var waitForTinyMCE = window.setInterval(function() {
                if(typeof(tinyMCE) !== 'undefined' && typeof(tinyMCE.get2) == 'function' && tinyMCE.get2('content')!=undefined) {
                    content=jQuery('#content').val();
                    tinyMCE.get2('content').remove();
                    jQuery('#content').val(content);
                    window.clearInterval(waitForTinyMCE);
                }
            }, 250);

WITH: Only change the 250 to 500 :) this should solve the problem...

var waitForTinyMCE = window.setInterval(function() {
                if(typeof(tinyMCE) !== 'undefined' && typeof(tinyMCE.get2) == 'function' && tinyMCE.get2('content')!=undefined) {
                    content=jQuery('#content').val();
                    tinyMCE.get2('content').remove();
                    jQuery('#content').val(content);
                    window.clearInterval(waitForTinyMCE);
                }
            }, 500);
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.