Commit f6bdc5d512f for woocommerce

commit f6bdc5d512fbbc032976bdceacdb888825590356
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date:   Mon Jun 8 08:31:54 2026 +0200

    Rename Products (Beta) block to Products (Deprecated) (#65523)

    * Rename Product (Beta) block to Product (Deprecated)

    * Hook into render_block_core/query instead of render_block in ProductQuery.php

    * Add defensive check when available_controls is undefined

    * Add changelog

    * Markdown linting

diff --git a/plugins/woocommerce/changelog/fix-product-query-fixes b/plugins/woocommerce/changelog/fix-product-query-fixes
new file mode 100644
index 00000000000..5536635b0f7
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-product-query-fixes
@@ -0,0 +1,4 @@
+Significance: patch
+Type: tweak
+
+Rename Products (Beta) block to Products (Deprecated)
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/upgrade-notice.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/upgrade-notice.tsx
index 7450092c28e..a2b822275aa 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/upgrade-notice.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/upgrade-notice.tsx
@@ -9,7 +9,7 @@ import { UpgradeDowngradeNotice } from '@woocommerce/editor-components/upgrade-d
 export const UpgradeNotice = ( props: { upgradeBlock: () => void } ) => {
 	const notice = createInterpolateElement(
 		__(
-			'Upgrade all Products (Beta) blocks on this page to <strongText /> for more features!',
+			'Upgrade all Products blocks on this page to <strongText /> for more features!',
 			'woocommerce'
 		),
 		{
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/utils.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/utils.tsx
index 52d40a99929..3bec275975c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/utils.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/utils.tsx
@@ -99,6 +99,10 @@ export function useAllowedControls(
 		[ attributes ]
 	);

+	if ( ! Array.isArray( controls ) ) {
+		return [];
+	}
+
 	if ( ! isSiteEditorPage() ) {
 		return controls.filter( ( control ) => control !== 'wooInherit' );
 	}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/variations/product-query.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/variations/product-query.tsx
index 9dfb0833fd8..fce9a7e6450 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/variations/product-query.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/variations/product-query.tsx
@@ -45,7 +45,7 @@ const registerProductsBlock = ( attributes: QueryBlockAttributes ) => {
 		),
 		name: PRODUCT_QUERY_VARIATION_NAME,
 		/* translators: "Products" is the name of the block. */
-		title: __( 'Products (Beta)', 'woocommerce' ),
+		title: __( 'Products (Deprecated)', 'woocommerce' ),
 		isActive: ( blockAttributes ) =>
 			blockAttributes.namespace === PRODUCT_QUERY_VARIATION_NAME,
 		icon: (
diff --git a/plugins/woocommerce/client/blocks/assets/js/shared/hocs/with-product-data-context.js b/plugins/woocommerce/client/blocks/assets/js/shared/hocs/with-product-data-context.js
index 0349f303a63..5d391d2ebcb 100644
--- a/plugins/woocommerce/client/blocks/assets/js/shared/hocs/with-product-data-context.js
+++ b/plugins/woocommerce/client/blocks/assets/js/shared/hocs/with-product-data-context.js
@@ -11,7 +11,7 @@ const getProductById = ( products, id ) =>
 	products.find( ( product ) => product.id === id );

 const getProductId = ( isDescendentOfQueryLoop, productId, postId ) => {
-	// Keep for backwards compatibility of Products (Beta) block.
+	// Keep for backwards compatibility of Products (Deprecated) block.
 	if ( isDescendentOfQueryLoop ) {
 		return postId;
 	}
diff --git a/plugins/woocommerce/client/blocks/docs/internal-developers/blockified-templates/compatibility-layer.md b/plugins/woocommerce/client/blocks/docs/internal-developers/blockified-templates/compatibility-layer.md
index f9d29a1fb25..d739678bd4e 100644
--- a/plugins/woocommerce/client/blocks/docs/internal-developers/blockified-templates/compatibility-layer.md
+++ b/plugins/woocommerce/client/blocks/docs/internal-developers/blockified-templates/compatibility-layer.md
@@ -20,7 +20,7 @@ Furthermore, it is possible to disable the compatibility layer via the hook: [`w

 ## Archive Product Templates - [ArchiveProductTemplatesCompatibility](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/src/Templates/ArchiveProductTemplatesCompatibility.php)

-The compatibility is built around the Product Collection and Products (Beta) blocks because the loop is the main element of archive templates and hooks are placed inside and around the loop. The Compatibility Layer injects custom attributes for the Product Collection and Products (Beta) blocks that **inherit query from the template** and their inner blocks.
+The compatibility is built around the Product Collection block because the loop is the main element of archive templates and hooks are placed inside and around the loop. The Compatibility Layer injects custom attributes for the Product Collection block that **inherit query from the template** and their inner blocks.

 The following table shows where the hooks are injected into the page.

@@ -46,16 +46,16 @@ The compatibility is built around the entire page. The classic Single Product Pa
 The following table shows where the hooks are injected into the page.


-| Hook                                      | Block Name                                                                                                                                             | Position |
-|-------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
-| woocommerce_before_main_content           | First block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | before   |
-| woocommerce_after_main_content            | Last block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs)  | after    |
-| woocommerce_sidebar                       | Last block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs)  | after    |
-| woocommerce_before_single_product         | First block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | before   |
-| woocommerce_before_single_product_summary | First block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | before |
-| woocommerce_single_product_summary        | First `core/post-excerpt` or `woocommerce/product-summary` block                                                                                                                         | before   |
-| woocommerce_after_single_product          | Last block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs)  | after    |
-| woocommerce_product_meta_start            | Product Meta                                                                                                                                           | before   |
-| woocommerce_product_meta_end              | Product Meta                                                                                                                                           | after    |
-| woocommerce_share                         | Product Details                                                                                                                                        | before   |
-| woocommerce_after_single_product_summary  | Product Details                                                                                                                                        | before   |
+| Hook                                     | Block Name                                                                                                                                             | Position|
+|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
+| woocommerce_before_main_content          | First block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs)| before  |
+| woocommerce_after_main_content           | Last block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | after   |
+| woocommerce_sidebar                      | Last block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | after   |
+| woocommerce_before_single_product        | First block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs)| before  |
+| woocommerce_before_single_product_summary| First block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs)| before  |
+| woocommerce_single_product_summary       | First `core/post-excerpt` or `woocommerce/product-summary` block                                                                                       | before  |
+| woocommerce_after_single_product         | Last block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | after   |
+| woocommerce_product_meta_start           | Product Meta                                                                                                                                           | before  |
+| woocommerce_product_meta_end             | Product Meta                                                                                                                                           | after   |
+| woocommerce_share                        | Product Details                                                                                                                                        | before  |
+| woocommerce_after_single_product_summary | Product Details                                                                                                                                        | before  |
diff --git a/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/product-collection.block_theme.spec.ts b/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/product-collection.block_theme.spec.ts
index b3a31f17387..dfad3cadc25 100644
--- a/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/product-collection.block_theme.spec.ts
+++ b/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/product-collection.block_theme.spec.ts
@@ -48,7 +48,7 @@ test.describe( 'Product Collection', () => {
 		await expect( pageObject.addToCartButtons ).toHaveCount( 9 );
 	} );

-	test( 'Can be migrated to from Products (Beta) block', async ( {
+	test( 'Can be migrated to from Products (Deprecated) block', async ( {
 		page,
 		editor,
 		admin,
@@ -63,7 +63,7 @@ test.describe( 'Product Collection', () => {
 		} );

 		await expect(
-			editor.canvas.getByLabel( 'Block: Products (Beta)' )
+			editor.canvas.getByLabel( 'Block: Products (Deprecated)' )
 		).toBeVisible();

 		await editor.canvas
@@ -76,7 +76,7 @@ test.describe( 'Product Collection', () => {
 			.click();

 		await expect(
-			editor.canvas.getByLabel( 'Block: Products (Beta)' )
+			editor.canvas.getByLabel( 'Block: Products (Deprecated)' )
 		).toBeHidden();
 		await expect(
 			editor.canvas.getByLabel( 'Block: Product Collection' ).first()
diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/ProductQuery.php b/plugins/woocommerce/src/Blocks/BlockTypes/ProductQuery.php
index c88541c7ad2..abf193797ff 100644
--- a/plugins/woocommerce/src/Blocks/BlockTypes/ProductQuery.php
+++ b/plugins/woocommerce/src/Blocks/BlockTypes/ProductQuery.php
@@ -77,7 +77,7 @@ class ProductQuery extends AbstractBlock {
 			2
 		);
 		add_filter(
-			'render_block',
+			'render_block_core/query',
 			array( $this, 'enqueue_styles' ),
 			10,
 			2
@@ -165,7 +165,7 @@ class ProductQuery extends AbstractBlock {
 	 * @return string The block content.
 	 */
 	public function enqueue_styles( string $block_content, array $block ) {
-		if ( 'core/query' === $block['blockName'] && self::is_woocommerce_variation( $block ) ) {
+		if ( self::is_woocommerce_variation( $block ) ) {
 			wp_enqueue_style( 'wc-blocks-style-product-query' );
 		}