Skip to content

Fix: Add version 3 migration for theme.json in post-featured-image block#69787

Closed
Sourav61 wants to merge 1 commit intoWordPress:trunkfrom
Sourav61:fix/handle-theme-json-version-3-migration
Closed

Fix: Add version 3 migration for theme.json in post-featured-image block#69787
Sourav61 wants to merge 1 commit intoWordPress:trunkfrom
Sourav61:fix/handle-theme-json-version-3-migration

Conversation

@Sourav61
Copy link
Copy Markdown
Contributor

@Sourav61 Sourav61 commented Apr 1, 2025

What?

Closes #69769
This PR fixes the issue related to the migration handling for theme.json versions, specifically by adding support for version 3 of the theme.json configuration. The changes ensure that the block correctly handles the aspect ratio and height attributes during migration.

Why?

This PR is necessary because there is an issue with the migration process of theme.json versions 1 and 2 to version 3. Specifically, the migration logic was not handling version 3 correctly, leading to problems with setting the aspect ratio for blocks. This fix ensures that migration to version 3 works seamlessly.

How?

This PR addresses the issue by:

  1. Adding a switch case to handle theme.json version 3 during migration.
  2. Ensuring that the aspect ratio and height attributes are migrated properly from version 2 to version 3.
  3. Preventing issues where blocks would fail to render correctly when migrating from version 2 to 3

Testing Instructions

  1. Check the migration logic by using a theme.json with version 2.
  2. Ensure the migration to version 3 works properly, and aspect ratio and height attributes are applied correctly.
  3. Verify that blocks using the post-featured-image block are rendered correctly after the migration.

Add version 3 migration for theme.json in post-featured-image block
@Sourav61 Sourav61 closed this Apr 1, 2025
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

Successfully merging this pull request may close these issues.

Featured image block: The default aspectRatio set in theme.json doesn't work

1 participant