Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22284 closed defect (bug) (fixed)

Beta Media button fails on frontend

Reported by: travel-junkie's profile travel-junkie Owned by:
Milestone: 3.5 Priority: low
Severity: normal Version: 3.5
Component: Media Keywords:
Focuses: Cc:


Basically, if you add wp_editor() somewhere on the frontend and then hit the new beta media button you get a JS error (TypeError: e is undefined) in underscore.min.js.

Tested this with the latest trunk on TwentyTwelve with no active plugins.

Attachments (3)

22284.diff (1.2 KB) - added by lessbloat 12 years ago.
22284.2.diff (1.1 KB) - added by lessbloat 12 years ago.
22284.3.diff (1.3 KB) - added by lessbloat 12 years ago.

Download all attachments as: .zip

Change History (18)

#1 @SergeyBiryukov
12 years ago

  • Component changed from External Libraries to Media

#2 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.5

#3 @bpetty
12 years ago

Using this inside the Twenty Twelve theme...

wp_editor('Test content', 'frontend_editor');

There's certainly something wrong here as I also get JS errors:

Uncaught TypeError: Cannot call method 'replace' of undefined     underscore.min.js:5
T.template                                                        underscore.min.js:5
_.extend.template                                                 media-models.js:63
media.view.AttachmentDisplaySettings.Backbone.View.extend.render  media-views.js:1174 media-views.js:769 media-views.js:731
g.View                                                            backbone.min.js:33
d                                                                 backbone.min.js:38
d                                                                 backbone.min.js:38
media.controller.Workflow.Backbone.Model.extend.view              media-views.js:88
media.controller.Workflow.Backbone.Model.extend.render            media-views.js:115                                                          media-models.js:18                                                  media-upload.js:105                                                 media-upload.js:164
p.event.dispatch                                                  jquery.js:2
p.event.add.g.handle.h                                            jquery.js:2
Last edited 12 years ago by bpetty (previous) (diff)

#4 @nacin
12 years ago

This was 3 weeks ago. Is this still reproducible?

#5 @koopersmith
12 years ago

In 22699:

Media: Improve media buttons on the front end.

  • Use a less specific selector (the body, actually) to delegate opening the media dialog.
  • Allow the editor ID to be the empty string so the media_buttons action can be called without arguments.

see #22284, #21390.

#6 @koopersmith
12 years ago

Using media on the frontend with wp_editor() currently does not cause any errors. That said, we could use a few bits of CSS to lock the styles in place.

Enqueuing anything that depends on wp-plupload (such as media-upload) without calling wp_plupload_default_settings() first will cause any dependent script to break, as wp.Uploader bails without its settings. The best way to fix this at the moment is probably to inspect whether the wp-plupload script is enqueued at the standard script printing points, and if so, generate its settings first.

#7 @koopersmith
12 years ago

  • Priority changed from normal to low

#8 @koopersmith
12 years ago

In 22776:

Media: Make media views dependent on jQuery UI sortable. see #22284, #21390.

12 years ago

#9 @lessbloat
12 years ago

Couple more base styles in 22284.diff.

#10 @koopersmith
12 years ago

In 22779:

Media: Use a more specific class for toolbar buttons. see #22284, #21390.

#11 @koopersmith
12 years ago

In 22780:

Media: Add base form element CSS. props lessbloat. see #22284, #21390.

12 years ago

#12 @lessbloat
12 years ago

A few more minor CSS tweaks in 22284.2.diff​.

12 years ago

#13 @lessbloat
12 years ago

22284.3.diff​ adds default link colors & removes need for !important.

#14 @koopersmith
12 years ago

In 22782:

Media: Normalize font sizes, link colors, and other styles. props lessbloat, see #22284, #21390.

#15 @koopersmith
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Closing this as fixed. If there are any additional display issues on the front-end, please open a new ticket.

Note: See TracTickets for help on using tickets.