Skip to content
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

Open
colis opened this issue Oct 29, 2024 · 2 comments
Open

Core/Image block validation errors in Block Patterns UI #996

colis opened this issue Oct 29, 2024 · 2 comments
Assignees

Comments

@colis
Copy link

colis commented Oct 29, 2024

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.

Content generated by `save` function:

<figure class="wp-block-image size-full"><img src="https://res.cloudinary.com/{app-name}/images/w_900,h_506,c_scale/v1708013415/media/820598-edited/820598-edited.jpg?_i=AA" alt="" class="wp-image-567226" style="object-fit:cover"/><figcaption class="wp-element-caption">This is a caption</figcaption></figure>

Content retrieved from post body:

<figure class="wp-block-image size-full"><img width="900" height="506" data-public-id="media/820598-edited/820598-edited.jpg" src="https://res.cloudinary.com/{app-name}/images/w_900,h_506,c_scale/v1708013415/media/820598-edited/820598-edited.jpg?_i=AA" alt="" class="wp-image-567226" style="object-fit:cover" data-format="jpg" data-transformations="" data-version="1708013415" data-seo="1" srcset="https://res.cloudinary.com/{app-name}/images/v1708013415/media/820598-edited/820598-edited.jpg?_i=AA 900w, https://res.cloudinary.com/{app-name}/images/v1708013415/media/820598-edited/820598-edited.jpg?_i=AA 300w, https://res.cloudinary.com/{app-name}/images/v1708013415/media/820598-edited/820598-edited.jpg?_i=AA 768w" sizes="(max-width: 900px) 100vw, 900px" /><figcaption class="wp-element-caption">This is a caption</figcaption></figure>

Steps to reproduce

  1. Create a block pattern that includes a core/image block with a Cloudinary image
  2. Go to /wp-admin/site-editor.php?postType=wp_block
  3. See the validation error appearing both in the Block Patterns listing page and in the Block Pattern edit page

Screenshots

Screenshot 2024-10-29 at 10 49 47

Screenshot 2024-10-29 at 10 50 03

Additional context

  • WordPress version: 6.6.2
  • Plugin version: 3.2.2
  • PHP version: 8.1
  • Plugin settings: Sync method manual, Storage Cloudinary and WordPress, Image Delivery ON, Image optimization OFF, Lazy loading OFF, Responsive images OFF
@Vdeub-cloudinary
Copy link

Hi @colis,
Thanks for reporting the issue.
It seems it is an edge case that bypassed the fix released in 3.2.2. I have been told a fix will be shipped in the next version for your issue.
I'll keep you posted when I have more vision on when this will be released.
Loic

@Vdeub-cloudinary Vdeub-cloudinary self-assigned this Oct 30, 2024
@colis
Copy link
Author

colis commented Oct 30, 2024

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)

Screenshot 2024-10-30 at 16 02 13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants