From 8ba32c4cd5618de442df54bd08152084fec82369 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Nov 2023 11:26:38 +0100 Subject: [PATCH] Release: 11.4.5 (#11672) * Empty commit for release pull request * Enhancement/New blockified Order Confirmation on new installs with block-based themes (#11615) * Use new blockified Order Confirmation on blocks themes * Handle translations on the new blockified Order Confirmation * Update readme.txt * npm run change-versions * Filter By Rating: fix overlapping stars (#11644) * Fix Playwright E2E tests - SideEffects (#11638) * Removed span text and test * Testing notes * Empty commit for release pull request * Fix Single Product Classic Template block not showing on the front-end (#11455) In WordPress 6.4, it appears that the global `have_posts` is `false` in the context of the full site editing single product template. This breaks the Classic Template block. In this commit, we are creating a custom query using the available id instead of relying on the global query. This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors. (cherry picked from commit d9e8809cc8cbdda67a9457c52f61bc040dbf346a) * Empty commit for release pull request * Update readme.txt * Bump versions to 11.4.5 * Add Testing Notes --------- Co-authored-by: github-actions Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> Co-authored-by: Luigi Teschio Co-authored-by: Lucio Giannotta --- composer.json | 2 +- .../internal-developers/testing/releases/1145.md | 16 ++++++++++++++++ .../testing/releases/README.md | 1 + package-lock.json | 4 ++-- package.json | 2 +- readme.txt | 8 +++++++- src/BlockTypes/ClassicTemplate.php | 11 +++++++++-- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 9 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 docs/internal-developers/testing/releases/1145.md diff --git a/composer.json b/composer.json index 2fbb07f7e44..294b2621c35 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "WooCommerce blocks for the Gutenberg editor.", "homepage": "https://woocommerce.com/", "type": "wordpress-plugin", - "version": "11.4.4", + "version": "11.4.5", "keywords": [ "gutenberg", "woocommerce", diff --git a/docs/internal-developers/testing/releases/1145.md b/docs/internal-developers/testing/releases/1145.md new file mode 100644 index 00000000000..38c20ab4087 --- /dev/null +++ b/docs/internal-developers/testing/releases/1145.md @@ -0,0 +1,16 @@ +# Testing notes and ZIP for release 11.4.5 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/13294232/woocommerce-gutenberg-products-block.zip) + +## WooCommerce Core + +### Bug Fixes + +#### Fix Single Product Classic Template block not showing on the front-end. [11455](https://github.com/woocommerce/woocommerce-blocks/pull/11455) + +1. Enable WordPress 6.4. +2. Enable a block theme. +3. Go to Site Editor → Single Product template. +4. Remove the blockified template and add the “Classic Template” block. +5. Save and check the front-end. +6. Check that the template is correctly rendered on the front-end. diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index 110db0afd73..07d10eca63a 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -186,6 +186,7 @@ Every release includes specific testing instructions for new features and bug fi - [11.4.2](./1142.md) - [11.4.3](./1143.md) - [11.4.4](./1144.md) + - [11.4.5](./1145.md) diff --git a/package-lock.json b/package-lock.json index 6500cf7c58d..fa182ec177c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@woocommerce/block-library", - "version": "11.4.4", + "version": "11.4.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@woocommerce/block-library", - "version": "11.4.4", + "version": "11.4.5", "hasInstallScript": true, "license": "GPL-3.0+", "dependencies": { diff --git a/package.json b/package.json index efcfa10f104..fd54b5f6c20 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "11.4.4", + "version": "11.4.5", "description": "WooCommerce blocks for the Gutenberg editor.", "homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/", "keywords": [ diff --git a/readme.txt b/readme.txt index 7243ce06bbf..6d50f1030ae 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 6.3.2 Tested up to: 6.3.2 Requires PHP: 7.4 -Stable tag: 11.4.4 +Stable tag: 11.4.5 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -81,6 +81,12 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 11.4.5 - 2023-11-07 = + +#### Bug Fixes + +- WordPress 6.4: fixed a bug which would break sites using the Classic Template block for the Single Product template. https://github.com/woocommerce/woocommerce-blocks/pull/11455 + = 11.4.4 - 2023-11-06 = #### Enhancements diff --git a/src/BlockTypes/ClassicTemplate.php b/src/BlockTypes/ClassicTemplate.php index 9b292f8bd02..90ea9e55d72 100644 --- a/src/BlockTypes/ClassicTemplate.php +++ b/src/BlockTypes/ClassicTemplate.php @@ -173,9 +173,16 @@ protected function render_single_product() { */ do_action( 'woocommerce_before_main_content' ); - while ( have_posts() ) : + $product_query = new \WP_Query( + array( + 'post_type' => 'product', + 'p' => get_the_ID(), + ) + ); + + while ( $product_query->have_posts() ) : - the_post(); + $product_query->the_post(); wc_get_template_part( 'content', 'single-product' ); endwhile; diff --git a/src/Package.php b/src/Package.php index 53cb37313ac..66d9ff438eb 100644 --- a/src/Package.php +++ b/src/Package.php @@ -109,7 +109,7 @@ public static function container( $reset = false ) { NewPackage::class, function ( $container ) { // leave for automated version bumping. - $version = '11.4.4'; + $version = '11.4.5'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index 2d6b7105b6b..04e9105adb7 100644 --- a/woocommerce-gutenberg-products-block.php +++ b/woocommerce-gutenberg-products-block.php @@ -3,7 +3,7 @@ * Plugin Name: WooCommerce Blocks * Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block * Description: WooCommerce blocks for the Gutenberg editor. - * Version: 11.4.4 + * Version: 11.4.5 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block