Support » Plugins and Hacks » [Resolved] [Plugin: Crayon Syntax Highlighter] Tag Editor Not Working

[Resolved] [Plugin: Crayon Syntax Highlighter] Tag Editor Not Working

  • Hi,

    I can’t get the tag editor to work in Chrome 18 on Mac. The button simply doesn’t do anything. Chrome Dev tools throws the following error when clicking it:

    4event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
    crayon_te.js:519Uncaught TypeError: Cannot call method ‘val’ of null
    (anonymous function)/content/plugins/crayon-syntax-highlighter/util/tag-editor/crayon_tinymce.js?ver=345-20111127:74


Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author akarmenia


    I’m also using a Mac, same browser version. I can’t replicate that error without passing in a null, and jQuery will pass an ‘undefined’ object instead if the setting isn’t found, which won’t generate the error. That function shouldn’t even be called with anything but a defined object…

    jQuery('.'+gs.setting).each(function() {
    			var setting = jQuery(this);
    			me.settingValue(setting, setting.attr(gs.orig_value));
    			// Update highlights

    setting should not be null/undefined there… What version of jQuery are you running? And is this happening when adding or editing a Crayon? Is it happening when editing a post or when adding a new post? Also try updating to 1.9.1 and making sure all the files are there in the /util/tag-editor/ folder.

    I had the same issue. Seems to be a problem with some themes.

    I fixed it by changing the following:

    In “util/tag-editor/crayon_te_content.php” move the line with wp_load_path behind the include of crayon_settings_wp.class.php.

    Orginal (Buggy) Code:

    require_once ($root . '/crayon_wp.class.php');
    require_once (CrayonWP::wp_load_path());
    require_once ($root.'/crayon_settings_wp.class.php');

    Fixed Code:

    require_once ($root . '/crayon_wp.class.php');
    require_once ($root.'/crayon_settings_wp.class.php');
    require_once (CrayonWP::wp_load_path());

    Then it worked in my case. Because the value of $root changed to my theme directory after the call of CrayonWP::wp_load_path().

    Plugin Author akarmenia


    Oh! Nice catch! That’s a little crazy, because it can only happen if another script which is loaded decided to do:

    global $root
    $root = '...'

    Which isn’t impossible, but unlikely. To avoid conflicts like this I’ve reordered it and also changed any global variables to include a crayon_ prefix, so this shouldn’t happen again. Try this zip:


    the <> does nothing now after the last update.. something is broken.

    Plugin Author akarmenia


    It’s working for me. Anything useful in the js console?

    nope.. no javascript errors:


    see the screencast


    some extra info: I’m using the plugin TinyMCE Advanced

    your crayon worked great before the update also with TinyMCE Advanced


    more info:

    tried it with internet explorer.. and it works there.

    but does not work with chrome.


    I’m back… problem solved… clearing the cache on chrome did it… apparently some cache data is causing problems with the crayon from the last version.


    Plugin Author akarmenia


    Ah great! Thanks for taking a look at it. WordPress appends a suffix “ver” variable that should prevent such issues, but I’m not using it for GET requests – as far as I know this is something ajaxurl should handle, but since I don’t provide it its likely not taking place. A minor problem I hope. I’ll fix it shortly.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] [Plugin: Crayon Syntax Highlighter] Tag Editor Not Working’ is closed to new replies.