WordPress.org

Ready to get started?Download WordPress

Forums

Simple Fields
[resolved] Cannot read property 'canvas' of undefined with TinyMCE (11 posts)

  1. mookasaurus
    Member
    Posted 2 years ago #

    After upgrading to WordPress to 3.3, I got this error:

    Uncaught TypeError: Cannot read property 'canvas' of undefined

    I only get this error when I'm on the edit page with simple fields textarea that has TinyMCE, no Javascript works on that page. When I disable the TinyMCE (uncheck Use HTML-editor in the settings), the error is gone.

    Other people don't seem to have this problem so I'm wondering if there's anything I missed. Any suggestion would be appreciated. Thank you so much in advance!

    http://wordpress.org/extend/plugins/simple-fields/

  2. idowning
    Member
    Posted 2 years ago #

    mookasaurus - I'm running into the same error. Thanks for the point about unchecking the Use HTML-editor. I'll use that until I can find a solution or get an update.

  3. mookasaurus
    Member
    Posted 2 years ago #

    Thank you for your confirmation, idowning. The error is not good but It's good to know I'm not the only one getting it ;)

    I really want to upgrade to 3.3 but I also need the editor for the repeatable fields so for now I guess I'm stuck with 3.2.1.

    My JS knowledge is very limited but I've investigated and it seems like in scripts.js, line 564, something doesn't like this line:

    simple_fields_metabox_tinymce_attach();

    I guess disabling this line gives the same result as unchecking the Use HTML-editor checkbox because the error is gone with the editor. Anyway, I say it just in case it might be useful for someone who can fix it.

    Thank you again in advance!

  4. idowning
    Member
    Posted 2 years ago #

    mookasaurus,

    I'll look into the js elements and see if I can't find something.

    I also ran into another error where in the content it doesn't allow you to select an image from the media gallery.

    Hope a fix comes soon.

  5. mookasaurus
    Member
    Posted 2 years ago #

    idowning, Have you seen this post about the media gallery upload?

    http://wordpress.org/support/topic/plugin-simple-fields-cant-select-images-from-library

    Still no luck with the TinyMCE. It's likely I will have to look for an alternative plugin :(

  6. mookasaurus
    Member
    Posted 2 years ago #

    Alright, after spending almost all day with some research, I guess the issue has something to do with the new API. My knowledge is very limited so I'll wait for the new Simple Fields update.

    Meanwhile, I've come up with a quick fix that I'd like to share, just in case someone need to have WP latest version running with TinyMCE in Simple Fields like me.

    I uncheck "Use HTML-editor" check box and add manually add TinyMCE using the snippet from the tutorial here:

    http://www.ilovecolors.com.ar/tinymce-plugin-textarea-metaboxes-wordpress/

    Paste the code in functions_post.php, under the close bracket of "echo $media;"

    Then TinyMCE should appear, and you'll run into another problem when trying to insert an image from the library but thanks to cm258 from this post:

    http://wordpress.org/support/topic/plugin-simple-fields-cant-select-images-from-library?replies=2

    The thing is, in WordPress 3.3, wp_tiny_mce() is deprecated so I'm not very happy with this dirty fix but it's working so far so hopefully the real fix from Simple Fields will come out soon.

    Thanks to Pär Thernström for the great plugin though!

  7. idowning
    Member
    Posted 2 years ago #

    mookasaurus great workaround! Yes the plugin still needs to be fixed, but I for one am very thankful you figured out a way to get it working.

    THANKS!!!

  8. mookasaurus
    Member
    Posted 2 years ago #

    I'm glad it's helpful :)

  9. sguk
    Member
    Posted 2 years ago #

    Same problems here.
    I must add on the developers website he has a note here http://eskapism.se/blogg/2011/12/wordpress-3-3-and-simple-fields-not-work/

    I saw on his twitter page that he had been given donations by some people but they were very small. Apparently he is from Sweden and it's very expensive to live there (like anywhere these days!!)

    I'm sure if more of us can donate he will update the plugin. He said he'll definitely do it, but doesn't know when.
    It's an awesome plugin and if he's reading this, we all totally appreciate your work.

  10. Thomas van der Westen
    Member
    Posted 2 years ago #

    I also hope for a update. I just emailed Pär (the maker) if he can give us any update.

  11. Sam_a
    Member
    Posted 2 years ago #

    I also see the "Uncaught TypeError…" in WordPress 3.3.1 + SimpleFields 0.4:

    Uncaught TypeError: Cannot read property 'canvas' of undefined (quicktags.dev.js:550)
    	qt.closeAllTags (quicktags.dev.js:550)
    	switchEditors.go (editor.dev.js:31)
    	simple_fields_metabox_tinymce_attach (scripts.js:53)
    	[…]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic