Skip to content

[Backport to release/11.3] Restore Product Query block registration on WordPress 7.2 - #70088

Merged
gigitux merged 1 commit into
release/11.3from
cherry-pick-PR70080-to-release/11.3
Oct 21, 2026
Merged

gigitux merged 1 commit into
release/11.3from
cherry-pick-PR70080-to-release/11.3

Conversation

@woocommercebot

Copy link
Copy Markdown
Collaborator

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/editor state but subscribe to core/edit-site and core/edit-post; core/edit-site remains a valid store, but its notifications do not cover the post/template updates these callbacks read from core/editor.

For this reason, this PR subscribes to CORE_EDITOR_STORE and guards post-editor registration to preserve the Site Editor's template-specific defaults.

How to test the changes in this Pull Request:

  1. Use WordPress 7.2 beta 1 with a block theme and the PR's built blocks assets. Repeat the checks on WordPress 7.1.

  2. In Appearance > Editor, open the Product Catalog template and select an existing Products (Deprecated) block. Insert the variation using the browser console:

    const variation = wp.blocks.getBlockVariations( 'core/query' ).find(
        ( item ) => item.name === 'woocommerce/product-query'
    );
    wp.data.dispatch( 'core/block-editor' ).insertBlocks(
        wp.blocks.createBlock(
            'core/query',
            variation.attributes,
            wp.blocks.createBlocksFromInnerBlocksTemplate( variation.innerBlocks )
        )
    );
  3. Repeat 2 on trunk branch.

  4. See the error in the console.

  5. 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.ts 

Milestone

Note: Check the box above to have the milestone automatically assigned when merged.
Alternatively (e.g. for point releases), manually assign the appropriate milestone.

Changelog 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

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

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.

* Restore Product Query block variation registration

* Add changelog for Product Query registration fix

* restore tests
@github-actions github-actions Bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Oct 21, 2026
@woocommercebot woocommercebot added this to the 11.3.0 milestone Oct 21, 2026
@github-actions github-actions Bot added this to the 11.3.0 milestone Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

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.

@github-actions

Copy link
Copy Markdown
Contributor

Testing Guidelines

Hi @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:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: 0 B 🆕

Total Size: 0 B

compressed-size-action

@gigitux
gigitux merged commit 6825798 into release/11.3 Oct 21, 2026
42 of 44 checks passed
@gigitux
gigitux deleted the cherry-pick-PR70080-to-release/11.3 branch October 21, 2026 14:01
@github-actions github-actions Bot added the metric: feature freeze exception A tracking label for PRs that were merged after the feature freeze. label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metric: feature freeze exception A tracking label for PRs that were merged after the feature freeze. plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants