From e450db47496262f7ac309c27feed3bfc575ac583 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 27 Apr 2022 13:46:28 +0100 Subject: [PATCH] Release: 7.4.3 (#6335) * Empty commit for release pull request * Fix: Customizer fatal error for bundled woocommerce-blocks package (#6317) * Add 7.4.3 changelog to readme.txt * Release 7.4.3 testing instructions * Bumping version strings to new version. Co-authored-by: github-actions Co-authored-by: Tung Du Co-authored-by: tjcafferkey --- docs/testing/releases/743.md | 15 +++++++++++++++ docs/testing/releases/README.md | 1 + package.json | 2 +- readme.txt | 8 +++++++- src/BlockTypes/MiniCart.php | 12 ++++++++++-- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 7 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 docs/testing/releases/743.md diff --git a/docs/testing/releases/743.md b/docs/testing/releases/743.md new file mode 100644 index 00000000000..4eaa6a8fd40 --- /dev/null +++ b/docs/testing/releases/743.md @@ -0,0 +1,15 @@ +## Testing notes and ZIP for release 7.4.3 + +[woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-gutenberg-products-block/files/8570975/woocommerce-gutenberg-products-block.zip) + + +## Feature plugin and package inclusion in WooCommerce + +#### Bug Fixes + +### Fix Customizer fatal error on PHP 8. ([6317](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/6317)) + +1. Using a site running on PHP 8. +2. Activate WC 6.5 beta 1 and Storefront. +4. Go to Appearance > Customize. +5. See no fatal error, the Customizer is loading and working as expected. diff --git a/docs/testing/releases/README.md b/docs/testing/releases/README.md index bf414755766..28f037ed744 100644 --- a/docs/testing/releases/README.md +++ b/docs/testing/releases/README.md @@ -67,6 +67,7 @@ Every release includes specific testing instructions for new features and bug fi - [7.4.0](./740.md) - [7.4.1](./741.md) - [7.4.2](./742.md) + - [7.4.3](./743.md) --- diff --git a/package.json b/package.json index 116d94b5c7b..9ac5cfeddff 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "7.4.2", + "version": "7.4.3", "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 97c5076dd04..2db157f4aa1 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 5.9 Tested up to: 5.9 Requires PHP: 7.0 -Stable tag: 7.4.2 +Stable tag: 7.4.3 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -86,6 +86,12 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 7.4.3 - 27-04-2022 = + +#### Bug Fixes + +- Fix Customizer fatal error on PHP 8. ([6317](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/6317)) + = 7.4.2 - 2022-04-15 = #### Bug Fixes diff --git a/src/BlockTypes/MiniCart.php b/src/BlockTypes/MiniCart.php index 91c222f8f7c..2364c4b2c6a 100644 --- a/src/BlockTypes/MiniCart.php +++ b/src/BlockTypes/MiniCart.php @@ -150,8 +150,14 @@ protected function enqueue_data( array $attributes = [] ) { * * $wp_scripts->print_translations() calls load_script_textdomain() * which calls load_script_translations() containing the below filter. + * + * In Customzier, woocommerce_blocks_get_i18n_data_json doesn't exist + * at the time of this filter call. So we need checking for its + * existence to prevent fatal error. */ - remove_filter( 'pre_load_script_translations', 'woocommerce_blocks_get_i18n_data_json', 10, 4 ); + if ( function_exists( 'woocommerce_blocks_get_i18n_data_json' ) ) { + remove_filter( 'pre_load_script_translations', 'woocommerce_blocks_get_i18n_data_json', 10, 4 ); + } $script_data = $this->asset_api->get_script_data( 'build/mini-cart-component-frontend.js' ); @@ -187,7 +193,9 @@ protected function enqueue_data( array $attributes = [] ) { ); // Re-add the filter. - add_filter( 'pre_load_script_translations', 'woocommerce_blocks_get_i18n_data_json', 10, 4 ); + if ( function_exists( 'woocommerce_blocks_get_i18n_data_json' ) ) { + add_filter( 'pre_load_script_translations', 'woocommerce_blocks_get_i18n_data_json', 10, 4 ); + } $this->asset_data_registry->add( 'mini_cart_block_frontend_dependencies', diff --git a/src/Package.php b/src/Package.php index c0ad41fbfb5..0b298de3383 100644 --- a/src/Package.php +++ b/src/Package.php @@ -106,7 +106,7 @@ public static function container( $reset = false ) { NewPackage::class, function ( $container ) { // leave for automated version bumping. - $version = '7.4.2'; + $version = '7.4.3'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index 82b9c173ec3..992ba152441 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: 7.4.2 + * Version: 7.4.3 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block