WordPress.org

Ready to get started?Download WordPress

Forums

Visualizer
[resolved] JavaScript errors on New Post screen (9 posts)

  1. andyadams
    Member
    Posted 9 months ago #

    Hey there,

    Thanks for the great plugin. Really, really awesome.

    I'm hitting an issue with the New Post screen. 6 JavaScript errors are being thrown, and they look like this:


    Uncaught TypeError: Cannot read property 'model' of undefined model.js?ver=1.2.0:20
    Uncaught TypeError: Cannot read property 'model' of undefined collection.js?ver=1.2.0:19
    Uncaught TypeError: Cannot read property 'controller' of undefined controller.js?ver=1.2.0:4
    Uncaught TypeError: Cannot read property 'view' of undefined view.js?ver=1.2.0:4
    Uncaught TypeError: Cannot read property 'view' of undefined toolbar.js?ver=1.2.0:36
    Uncaught TypeError: Cannot read property 'view' of undefined media.js?ver=1.2.0:58

    It appears that wp.media isn't defined in the JS. Can you think of any reason why that might be? I'm not familiar with the internals of the media editor. Thanks!

    http://wordpress.org/plugins/visualizer/

  2. madpixels
    Member
    Plugin Author

    Posted 9 months ago #

    Hi @andyadams

    What version of WordPress do you use?

  3. andyadams
    Member
    Posted 9 months ago #

    Apologies for not including that. I'm on 3.6.1.

    This could very well be a conflict with another plugin - and thus not your problem - but I was just wondering if you could think of anything that would cause wp.media to not be instantiated, that'd be great.

    Here's a potential clue: We started investigating issues with the Visualizer when registering CPTs that don't support the 'editor'. When post_type_supports( 'editor' ) is false, some of the WP Admin code doesn't execute.

    Specifically, see wp-admin/edit-form-advanced.php lines 27-30 as a potential reason for the media not being enqueued in certain cases.

    Let me know if you have any questions about all of this - I'm happy to help debug, and I'll let you know if I can figure anything out.

  4. madpixels
    Member
    Plugin Author

    Posted 9 months ago #

    Thanks andyadams!
    I will test it on my end and will try to fix it.

  5. andyadams
    Member
    Posted 9 months ago #

    Thank you kindly. Let me know if I can help.

  6. madpixels
    Member
    Plugin Author

    Posted 9 months ago #

    Hi @andyadams

    Could you send me your email/skype/hangout via this form? I will send you fixed version to test if it removes your issue.

  7. andyadams
    Member
    Posted 9 months ago #

    Just sent it. Thank you kindly!

  8. madpixels
    Member
    Plugin Author

    Posted 9 months ago #

    I have sent you the plugin. Please, check your it and let me know if it fixes your issues.

    Thanks!

  9. andyadams
    Member
    Posted 8 months ago #

    The fix you sent works! I look forward to seeing it in a new release!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.