WordPress.org

Make WordPress Core

Opened 16 months ago

Closed 16 months ago

Last modified 3 months ago

#27763 closed defect (bug) (fixed)

Plupload 2.x Compatibility

Reported by: kovshenin Owned by: kovshenin
Milestone: 3.9 Priority: highest omg bbq
Severity: major Version: 3.9
Component: External Libraries Keywords: has-patch
Focuses: Cc:

Description

Three things we can do here to cause less plugin breakage:

  1. Rename Moxie.swf and .xap back to what they were in 3.8. Some plugins may be referencing these directly, because there's no easier way to get an array of core's default settings for Plupload.
  1. Make wp_plupload_default_settings() more generic, so developers can use it to get an array of default settings for Plupload. Currently you can call it only once and it adds a JS object to the wp-plupload handle. Doesn't return anything.
  1. Bring back the plupload-{runtime} script handles. Apparently some folks are using these in dependency arrays.

Anything else? Related: #25663 r27316

Attachments (3)

27763.diff (2.6 KB) - added by nacin 16 months ago.
27763.2.diff (3.0 KB) - added by azaozz 16 months ago.
27763.3.diff (4.8 KB) - added by azaozz 16 months ago.

Download all attachments as: .zip

Change History (14)

comment:1 @nacin16 months ago

  • Priority changed from normal to high
  • Severity changed from normal to major

comment:2 @nacin16 months ago

  • Owner set to kovshenin
  • Priority changed from high to highest omg bbq
  • Status changed from new to assigned

1 and 3 are easy wins. I'm for 2 as well, for sure.

comment:3 @azaozz16 months ago

3 makes sense. 2 would be good too. Not so sure about renaming parts of an external library... A quick search shows about 120 plugins that contain 'plupload.flash.swf'. The only alternative seems to be to copy Moxie.swf and Moxie.xap and rename them to plupload.flash.swf and plupload.silverlight.xap, show deprecated notice somehow, and remove them in 4.0.

Last edited 16 months ago by azaozz (previous) (diff)

@nacin16 months ago

comment:4 @nacin16 months ago

  • Keywords has-patch added; needs-patch removed

At this point, Plupload's new naming convention matters very little to me. 27763.diff moves them back, makes plupload the primary handle, and makes the rest of the old handles aliases.

I don't have an immediate solution to wp_plupload_default_settings(). It'd probably need a minimum of three arguments: $handle = 'wp-plupload', $js_variable = '_wpPluploadSettings', $args = array(). The args can then be merged into defaults. Or, a new wp_plupload_settings() function that abstracts this.

@azaozz16 months ago

comment:5 @azaozz16 months ago

Patch looks good. 27763.2.diff also changes back the names in the Plupload settings for the Media -> Add New screen.

+1 for wp_plupload_settings() that will be used in both wp_plupload_default_settings() in wp-includes/media.php and media_upload_form() in wp-admin/includes/media.php. Can probably add that in 4.0.

Last edited 16 months ago by azaozz (previous) (diff)

@azaozz16 months ago

comment:6 @azaozz16 months ago

27763.3.diff includes the actual file rename and svn props.

comment:7 @nacin16 months ago

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

In 28108:

Plupload: Restore 3.8 handles and filenames to avoid breaking plugins.

fixes #27763.

comment:8 @nacin16 months ago

We can introduce a better method for plugin developers in 4.0, but wp_plupload_default_settings() is not a simple function so I don't know if we can or should rush in an abstraction. [28108] restores backwards compatibility for 3.9, so anything anyone has been doing *should* just continue to work. (Rarst, please confirm?)

If we missed anything back-compat wise, please reopen this ticket. Otherwise, can someone make a new ticket for wp_plupload_settings()? Thanks!

comment:9 @azaozz16 months ago

In 28110:

Plupload: restore the settings in media_upload_form(), see #27763

comment:10 @Rarst16 months ago

Everything seems to work fine for me after patches.

comment:11 @slackbot3 months ago

This ticket was mentioned in Slack in #core by ocean90. View the logs.

Note: See TracTickets for help on using tickets.