Repository navigation
[Backport to release/11.3] Restore Product Query block registration on WordPress 7.2 - #70088
Conversation
* Restore Product Query block variation registration * Add changelog for Product Query registration fix * restore tests
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a commit that changes plugin code. |
Testing GuidelinesHi @gigitux , Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
|
Size Change: 0 B 🆕 Total Size: 0 B |
This PR is a cherry-pick of #70080 to
release/11.3.Original PR Description
Submission Review Guidelines:
Changes proposed in this Pull Request:
Products (Deprecated) loses its WooCommerce controls on WordPress 7.2 because Gutenberg PR #83346 replaces the global fallback for subscriptions to unregistered stores with pending, store-specific listeners. Our callbacks read
core/editorstate but subscribe tocore/edit-siteandcore/edit-post;core/edit-siteremains a valid store, but its notifications do not cover the post/template updates these callbacks read fromcore/editor.For this reason, this PR subscribes to
CORE_EDITOR_STOREand guards post-editor registration to preserve the Site Editor's template-specific defaults.How to test the changes in this Pull Request:
Use WordPress 7.2 beta 1 with a block theme and the PR's built blocks assets. Repeat the checks on WordPress 7.1.
In Appearance > Editor, open the Product Catalog template and select an existing Products (Deprecated) block. Insert the variation using the browser console:
Repeat 2 on trunk branch.
See the error in the console.
Please run tests against WordPress 7.2:
WP_ENV_CORE=https://wordpress.org/wordpress-7.2-beta1.zip \ WP_ENV_PHP_VERSION=8.3 \ pnpm --filter=@woocommerce/plugin-woocommerce env:start:blocks WP_ENV_CORE=https://wordpress.org/wordpress-7.2-beta1.zip \ WP_ENV_PHP_VERSION=8.3 \ pnpm --filter=@woocommerce/plugin-woocommerce test:e2e:blocks:serial \ tests/e2e/tests/blocks/products/products.block_theme.spec.tsMilestone
Automatically assign milestone for the next WooCommerce versionChangelog entry
Automatically create a changelog entry from the details below.This Pull Request does not require a changelog entry. (Comment required below)Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment
Created manually.
Use of AI Tools
Codex extracted the Product Query fix and regression test from #70075 and assisted with the changelog, PR description, and local validation. Independent human review is pending.