-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core/Image block validation errors in Block Patterns UI #996
Comments
Hi @colis, |
Hi @Vdeub-cloudinary and thanks for the update. Just so you know, the issue also happens when saving a regular page, it doesn't seem to affect only block patterns. (version 3.2.2) |
Hi @jessica-townsend, thanks for bringing this up. |
with the latest version of the plugin (3.2.4) most of the validation issues have been fixed, however there is still one remaining
It looks like, on page load, the system applies some transformations to the image, which are not applied on save, hence the mismatch in the markup |
Hi @colis, Thanks for letting me know. Is it also happening for newly created posts? Thanks! |
it also happens for newly created patterns, yes |
Thanks for letting me know @colis, I'll reach out to the team and let you know. |
@colis, any chance you could share a system report with the post details as described here? |
@Vdeub-cloudinary sure, here's the report from a local environment cloudinary-report-1737551388.json We're not using the |
@colis, would you be available for a call with our development team to discuss this issue? If so, could you please share your availabilities? Thanks! |
@Vdeub-cloudinary sure! Wed 5 Feb: 14:00-18:00 (CET) Thanks! |
Hi @colis – in order to disable Cloudinary processing in Gutenberg context, which includes patterns, you might want to try this snippet: namespace Cloudinary;
add_action(
'init',
function () {
$cloudinary = get_plugin_instance();
$delivery_module = $cloudinary->components['delivery'];
$uri = isset( $_SERVER['REQUEST_URI'] ) && is_string( $_SERVER['REQUEST_URI'] )
? esc_url_raw( $_SERVER['REQUEST_URI'] )
: '';
// We can't rely on `wp_is_serving_rest_request()`, because it's not available
// early enough in the request lifecycle.
$is_rest_blocks_request = strpos( $uri, '/wp/v2/block' ) !== false;
if ( $delivery_module && $is_rest_blocks_request ) {
remove_action( 'cloudinary_string_replace', array( $delivery_module, 'catch_urls' ), 10 );
}
},
150
); Depending on how you consume data from the headless WP, this may only bypass the unwanted processing in the WP admin, while not affecting the data you get through regular WP REST API endpoints. In case you need to access the Thank you! |
Bug Description
Block Patterns that use Cloudinary images trigger validation errors when viewed/edited from the dedicated Block Patterns admin UI (accessible at /wp-admin/site-editor.php?postType=wp_block).
Despite being able to fix the validation error by clicking the "Attempt Block Recovery" button, the issue reappears on subsequent page loads.
It looks like a number of additional HTML attributes are being added to the markup but not saved to the DB, which is what seems to trigger the validation errors.
Steps to reproduce
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: