• I’ve got an consol error ‘TypeError: hook is undefined’ in Firebug and the editor does not load eiter the translation tabs. The content just contains the qTranslate formatted strings: <!–:hu–>Kapcsolat<!–:–><!–:en–>Contact<!–:–><!–:de–>Verbindung<!–:–><!–:it–>Contatti<!–:–>

    https://www.ads-software.com/plugins/qtranslate-x/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Clause

    (@johnclause)

    Does it happen under standard Wp with qtx the only plugin? If not, look for a conflicting plugin.

    Thread Starter vokopeti

    (@vokopeti)

    Hi John,

    Thank you for your quick reply!
    Yes, I’ve disabled all the plugins but qtx and it still does not load the editor either on WordPress 4.2.2.
    I’ve uploaded some screengrabs for you. If you could help me that would be great!

    Thank you!
    Peter

    https://oi60.tinypic.com/imq9g5.jpg
    https://oi58.tinypic.com/2ah8y3c.jpg
    https://oi61.tinypic.com/a2rm39.jpg

    <script type="text/javascript">
    // <![CDATA[
    
    (function() {
    	for (var i in tinyMCEPreInit.qtInit) {
    		var tmp = tinyMCEPreInit.qtInit[i];
    		tmp.id = 'ppqtrans_textarea_'+tmp.id;
    
    		tinyMCEPreInit.qtInit[tmp.id] = tmp;
    		delete tinyMCEPreInit.qtInit[i];
    		jQuery('#ed_toolbar').hide();
    	}
    
    /// THE hook VARIABLE SEEMS TO BE UNDEFINED FOR SOME REASON!
    
    	var hook = tinyMCEPreInit.mceInit['content'];
    	hook.elements='hook-to-nothing';
    
    	hook.selector = '#ppqtrans_textarea_content';
    	delete tinyMCEPreInit.mceInit['content'];
    			tinyMCEPreInit.mceInit['ppqtrans_textarea_content'] = hook;
    
    	var wrap = jQuery('#wp-content-wrap');
    	var html = '<div id="wp-ppqtrans_textarea_content-wrap" class="' + wrap.prop('className') + '"></div>';
    	jQuery('body').append(html);
    		}());
    </script>
    byzgl

    (@byzgl)

    Replace:
    var html = ‘<div id=”wp-ppqtrans_textarea_content-wrap” class=”‘ + wrap.prop(‘className’) + ‘”></div>’;

    to this:

    var html = ‘<div id=\”wp-ppqtrans_textarea_content-wrap\” class=\”‘ + wrap.prop(‘className’) + ‘\”></div>’;

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘TypeError: hook is undefined’ is closed to new replies.