Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#50595 closed defect (bug) (fixed)

REST API: Allow media edit endpoint to find remote files

Reported by: jonsurrell's profile jonsurrell Owned by: jonsurrell's profile jonsurrell
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.5
Component: REST API Keywords: has-patch commit
Focuses: rest-api Cc:

Description

The media edit endpoint introduced in https://core.trac.wordpress.org/changeset/48291 fails to find files that are not on the local file system, for example when using some file replication plugins.

Use _load_image_to_edit_path to find remote images.

This is very similar to the approach currently in use in several places already, e.g.
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/image.php?rev=47461#L33

This fixes the issue described in https://github.com/WordPress/gutenberg/issues/23686.

Change History (5)

#1 @johnbillion
4 years ago

  • Milestone changed from Awaiting Review to 5.5
  • Version set to trunk

Thanks for the report @jonsurrell . Moving this to 5.5 for visibility.

This ticket was mentioned in PR #396 on WordPress/wordpress-develop by sirreal.


4 years ago
#2

  • Keywords has-patch added

The media edit endpoint introduced in https://core.trac.wordpress.org/changeset/48291 fails to find files that are not on the local file system, for example when using some file replication plugins.

Use _load_image_to_edit_path to find remote images.

This is very similar to the approach currently in use in several places already, e.g.
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/image.php?rev=47461#L33

This fixes the issue described in https://github.com/WordPress/gutenberg/issues/23686.

Trac ticket: https://core.trac.wordpress.org/ticket/50595

#3 @azaozz
4 years ago

  • Keywords commit added

Patch looks good. May also need to update _load_image_to_edit_path() to look for the original_image (when specified), but that can also be handled through the filters.

#4 @azaozz
4 years ago

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

In 48386:

Media, REST API: Allow media edit endpoint to find remote files.

Props jonsurrell.
Fixes #50595.

TimothyBJacobs commented on PR #396:


4 years ago
#5

Merged.

Note: See TracTickets for help on using tickets.