Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Release: 10.0.4 (#9357)
Browse files Browse the repository at this point in the history
* Empty commit for release pull request

* Add 10.0.3 changelog

* Update versions to 10.0.3

* Fix image editor in Featured Product/Category blocks on WP 6.2 (#9142)

* Add 10.0.3 testing steps

* Empty commit for release pull request

* Check that the customized fallback template is archive-product before unsetting the source property (#9330)

* use 'enqueue_block_assets' is available (#9332)

* Remove esc_url() on self generated link to edit the Mini Cart template since it gets escaped in JS (#9348)

* Add changelog entries to readme.txt

* Update version number in several files

* Add testing notes for the release

* Add #9332 to testing notes

* Add testing on frontend for #9332

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
  • Loading branch information
6 people authored May 5, 2023
1 parent a04006a commit 1ba86ab
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://woocommerce.com/",
"type": "wordpress-plugin",
"version": "10.0.3",
"version": "10.0.4",
"keywords": [
"gutenberg",
"woocommerce",
Expand Down
43 changes: 43 additions & 0 deletions docs/internal-developers/testing/releases/1004.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Testing notes and ZIP for release 10.0.4

Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11398343/woocommerce-gutenberg-products-block.zip)

## WooCommerce Core

### Check that the customized fallback template is archive-product before saving. [(9330)](https://github.com/woocommerce/woocommerce-blocks/pull/9330)

1. Go to Appearance > Site Editor and make sure no templates have any customizations
2. Make changes to Product Category and save.
3. Check these are reflected on the frontend.
4. Repeat step 2
5. Check these are reflected on the frontend, and also in the templates list check this has not created an additional template as previously demonstrated in the linked issue.
6. Now clear all customizations again
7. Customize the Product Catalog template and save
8. Check these are reflected on the frontend for the product archive page, and all taxonomy pages (Category/Tags etc)
9. In the Site Editor make some customizations to the Product Category page and save.
10. Make sure these are reflected on the frontend, and also in the templates list check this has not created an additional template as previously demonstrated in the linked issue.
11. Make sure that the Product Catalog changes are still as intended and are reflected on the product archive page, and all taxonomy pages _except_ Product Category (since we have now created its own customized version in Step 9)

### Fix: Edit Mini Cart template part URL [(9348)](https://github.com/woocommerce/woocommerce-blocks/pull/9348)

1. Go to Appearance > Site Editor > Template Parts > Header
2. Add the Mini Cart block to the header. In the settings panel see the link "Edit Mini Basket template part".
3. Clicking this link should take you to the correct URL.

### Use 'enqueue_block_assets' action when is available [(9332)](https://github.com/woocommerce/woocommerce-blocks/pull/9332)

*Pre-requisites*
- Make sure to have some other plugins installed and activated (for example: Stripe)

*Testing on the Site Editor*
1. Be sure that you have the Gutenberg trunk installed.
2. Open the Site Editor, and open the Single Product Template.
3. See that the placeholder image is loaded.
4. Disable the Gutenberg plugin.
5. Open the Site Editor, and open the Single Product Template.
6. See that the placeholder image is loaded.

*Testing on the frontend*
1. With the Stripe plugin activated, go to your store;
6. Add a product to the cart;
6. Check if you are able to finish an order without errors;
1 change: 1 addition & 0 deletions docs/internal-developers/testing/releases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ Every release includes specific testing instructions for new features and bug fi
- [10.0.1](./1001.md)
- [10.0.2](./1002.md)
- [10.0.3](./1003.md)
- [10.0.4](./1004.md)


<!-- FEEDBACK -->
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@woocommerce/block-library",
"title": "WooCommerce Blocks",
"author": "Automattic",
"version": "10.0.3",
"version": "10.0.4",
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
"keywords": [
Expand Down
11 changes: 9 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
Requires at least: 6.1
Tested up to: 6.2
Requires PHP: 7.3
Stable tag: 10.0.3
Stable tag: 10.0.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -80,7 +80,14 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/

== Changelog ==

= 10.0.3 - 2023-04-21 =
= 10.0.4 - 2023-05-04 =

#### Bug Fixes

- Fix "Edit Mini Cart template part" URL for the Mini Cart block. ([9348](https://github.com/woocommerce/woocommerce-blocks/pull/9348))
- Fix duplicate taxonomy templates being created on every save. ([9330](https://github.com/woocommerce/woocommerce-blocks/pull/9330))

= 10.0.3 - 2023-04-20 =

#### Bug Fixes

Expand Down
16 changes: 15 additions & 1 deletion src/Assets/AssetDataRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,25 @@ public function __construct( Api $asset_api ) {
* Hook into WP asset registration for enqueueing asset data.
*/
protected function init() {
add_action( 'init', array( $this, 'register_data_script' ) );
if ( $this->is_site_editor() ) {
add_action( 'enqueue_block_editor_assets', array( $this, 'register_data_script' ) );
} else {
add_action( 'init', array( $this, 'register_data_script' ) );
}
add_action( 'wp_print_footer_scripts', array( $this, 'enqueue_asset_data' ), 2 );
add_action( 'admin_print_footer_scripts', array( $this, 'enqueue_asset_data' ), 2 );
}

/**
* Checks if the current URL is the Site Editor.
*
* @return boolean
*/
protected function is_site_editor() {
$url_path = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
return str_contains( $url_path, 'site-editor.php' );
}

/**
* Exposes core data via the wcSettings global. This data is shared throughout the client.
*
Expand Down
2 changes: 1 addition & 1 deletion src/BlockTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function get_block_template_fallback( $template, $id, $template_type ) {
return null;
}

if ( count( $posts ) > 0 ) {
if ( count( $posts ) > 0 && 'archive-product' === $posts[0]->post_name ) {
$template = _build_block_template_result_from_post( $posts[0] );

if ( ! is_wp_error( $template ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static function container( $reset = false ) {
NewPackage::class,
function ( $container ) {
// leave for automated version bumping.
$version = '10.0.3';
$version = '10.0.4';
return new NewPackage(
$version,
dirname( __DIR__ ),
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-gutenberg-products-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: 10.0.3
* Version: 10.0.4
* Author: Automattic
* Author URI: https://woocommerce.com
* Text Domain: woo-gutenberg-products-block
Expand Down

0 comments on commit 1ba86ab

Please sign in to comment.