Jetpack: Photon: ensure compatibility with Block editor

Created on 9 Nov 2018  路  3Comments  路  Source: Automattic/jetpack

Steps to reproduce the issue

The issue is described in details here: https://github.com/WordPress/gutenberg/issues/8734

The problem is related to the image_downsize filter, which is normally suppressed (in both Photon and ExactDN) by a call to is_admin(), but Gutenberg doesn't use admin-ajax, it uses the REST API, which doesn't send any signals about being in wp-admin.
[...]
Photon and ExactDN should pre-empt the parsing of image_downsize for the REST API when it is detected that the request is made from the editor.

Gutenberg Photon [Pri] High [Type] Bug

All 3 comments

FYI, this now happens again for new uploads in the block editor, because $request['context'] is not set.
I'm using this:
if ( is_string( $route ) && false !== strpos( $route, 'wp/v2/media' ) && ! empty( $request['post'] ) && ! empty( $request->get_file_params() ) )...

@nosilver4u Thanks for the comment. It just happened that #16035 was reported earlier today.

Was this page helpful?
0 / 5 - 0 ratings