Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media upload doesn’t work with AJAX editor #3

Open
thefuxia opened this issue Jan 27, 2014 · 0 comments
Open

Media upload doesn’t work with AJAX editor #3

thefuxia opened this issue Jan 27, 2014 · 0 comments
Labels

Comments

@thefuxia
Copy link
Owner

When media uploads are enabled in the AJAX Editor, the upload button is visible, but clicking it raises just an error:

Uncaught exception: TypeError: Cannot convert 'n' to object
Error thrown at line 595, column 2 in <anonymous function: w.template>(n, t, r):
    n.replace(u, function(t, r, e, u, o) {
called from line 27, column 3 in <anonymous function>(data):
    compiled = compiled || _.template( $( '#tmpl-' + id ).html(), , options );
called from line 2939, column 3 in <anonymous function: css>():
    media.view.Attachments.$head().append( this.cssTemplate({
called as bound function from line 2924, column 3 in <anonymous function: initialize>():
    this.css();
called via Function.prototype.apply() from line 3521, column 3 in <anonymous function: initialize>():
    return media.view.Attachments.prototype.initialize.apply( this, arguments );
called via Function.prototype.apply() from line 773, column 3 in <anonymous function: a.View>(t):
    this.initialize.apply(this, arguments);
called via Function.prototype.apply() from line 347, column 3 in <anonymous function: constructor>():
    Backbone.View.apply( this, arguments );
called via Function.prototype.apply() from line 880, column 3 in <anonymous function: constructor>(options):
    wp.Backbone.View.apply( this, arguments );
called via Function.prototype.apply() from line 1121, column 5 in <anonymous function: r>():
    return i.apply(this, arguments)
called via Function.prototype.apply() from line 1121, column 5 in <anonymous function: r>():
    return i.apply(this, arguments)

To debug that, I have replaced the minified underscore.js with an unminified version from the original repo (not included in WordPress core for no obvious reasons). The error is now:

Uncaught exception: TypeError: Cannot convert 'text' to object
Error thrown at line 1130, column 4 in <anonymous function: _.template>(text, data, settings):
    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
called from line 27, column 3 in <anonymous function>(data):
    compiled = compiled || _.template( $( '#tmpl-' + id ).html(), , options );
called from line 2939, column 3 in <anonymous function: css>():
    media.view.Attachments.$head().append( this.cssTemplate({
called as bound function from line 2924, column 3 in <anonymous function: initialize>():
    this.css();
called via Function.prototype.apply() from line 3521, column 3 in <anonymous function: initialize>():
    return media.view.Attachments.prototype.initialize.apply( this, arguments );
called via Function.prototype.apply() from line 773, column 3 in <anonymous function: a.View>(t):
    this.initialize.apply(this, arguments);
called via Function.prototype.apply() from line 347, column 3 in <anonymous function: constructor>():
    Backbone.View.apply( this, arguments );
called via Function.prototype.apply() from line 880, column 3 in <anonymous function: constructor>(options):
    wp.Backbone.View.apply( this, arguments );
called via Function.prototype.apply() from line 1121, column 5 in <anonymous function: r>():
    return i.apply(this, arguments)
called via Function.prototype.apply() from line 1121, column 5 in <anonymous function: r>():
    return i.apply(this, arguments)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant