WordPress.org

Make WordPress Core

Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#50595 closed defect (bug) (fixed)

REST API: Allow media edit endpoint to find remote files

Reported by: jonsurrell Owned by: 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
15 months 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.


15 months ago

  • 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
15 months 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
15 months 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.

#5 @prbot
15 months ago

TimothyBJacobs commented on PR #396:

Merged.

Note: See TracTickets for help on using tickets.