WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 3.5 Beta 3 Load Scripts Error When Enqueuing Media Upload (6 posts)

  1. Nick Halsey
    Member
    Posted 1 year ago #

    The following javascript error is being thrown on pages in the WP admin in 3.5 beta3 where a custom script depending on jquery, media-upload, and thickbox is enqueued:

    Uncaught ReferenceError: _wpMediaViewsL10n is not defined at load-scripts.php:382.

    This error appears from two different plugins of mine (enqueuing the same script, but from different places), on exactly the pages where those scripts are enqueued. I don't believe this error was present in 3.5 Beta 2, but can't be sure (no issues in 3.4.2 or beta 1). The script uploads images through the (old) media uploader/media library and inserts the urls into text inputs in the settings.

    This probably has something to do with the new media features, and localization (l10n). It would be nice if plugins could use the new uploader for users to upload/insert media within plugin settings pages, but I'm guessing this either hasn't been implemented or hasn't been documented yet.

  2. MatthewRuddy
    Member
    Posted 1 year ago #

    Having the same issue here. Plugin functionality that uses old Media Uploader has been completely broken by Beta 3. Real pain. Was working in Beta 2.

    Starting to look like I'm going to have to invest time in adapting the new Media Uploader layout with Backbone.js. I was hoping that they would leave the old Media Uploader intact for backwards compatibility in 3.5, but hopes of that seem to have diminished as of Beta 3.

    Going to cause some major issues when the official upgrade is released if they don't revert to how things were in Beta 2! Can imagine a lot of broken plugins!

    Not great to have to require 3.5 as the minimum version as well. Not that I'm against it, I actually think it is extremely important to remain up to date. But a lot of average users don't upgrade to retain functionality for plugins that don't work with newer versions, and as such they will start getting alienated.

  3. Nick Halsey
    Member
    Posted 1 year ago #

    Looks like they're working on this now: http://core.trac.wordpress.org/ticket/21390. Hopefully we'll get documentation for the new media API and wp_enqueue_media() soon too, but if they are able to preserve full backward compatibility that'll help a lot!

    I'm completely writing most of my plugin, but have been able to nail down many of the current issues to being resultant of issues with this API (and how I'm using it). And as for upgrading, I agree that it should be strongly encouraged, although I've seen many users blatantly ignore ALL updates, and their site developers (not me) discourage updates in case their themes break (which is unlikely when using good practices, especially for relatively new sites).

  4. MatthewRuddy
    Member
    Posted 1 year ago #

    Good to hear. I agree, preserving backwards compatibility is essential I feel.

    You could try figuring out how to manipulate the new Media Uploader workflow now if you liked by reading up on the source code. I think I will do so in the coming weeks. Documentation probably won't be available for a little while. I can see that is uses backbone.js, so I can imagine it will just be a case of adding some new views and models. Adding backbone was a great move.

  5. alan-c
    Member
    Posted 1 year ago #

    Ignore 3.5 until there is some documentation. Just saying...

    WordPress: Here's a great new media uplaoder!!!!!!!
    Devs: How do we use it?
    WordPress: <crickets>

  6. jpSimkins
    Member
    Posted 1 year ago #

    You could try reading the code. It's not that hard... smh

Topic Closed

This topic has been closed to new replies.

About this Topic