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

Commit 0bbc654

Browse files
github-actions[bot]github-actionsAljullualbarin
authored
Release: 8.9.1 (#7670)
* Empty commit for release pull request * Display correct block template when filtering by attribute (#7640) * Fix error when trying to access the queried object when it's null (#7664) * Fix error when trying to access the queried object when it's null. * Check if the `slug` exists * Use the taxonomy name instead of the slug, otherwise it returns false * Update readme changelog * Add testing notes * Improve testing notes format * Bumping version strings to new version. Co-authored-by: github-actions <[email protected]> Co-authored-by: Albert Juhé Lluveras <[email protected]> Co-authored-by: Alba Rincón <[email protected]> Co-authored-by: Alba Rincón <[email protected]>
1 parent ed8df87 commit 0bbc654

File tree

8 files changed

+50
-10
lines changed

8 files changed

+50
-10
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Testing notes and ZIP for release 8.9.1
2+
3+
Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10001089/woocommerce-gutenberg-products-block.zip)
4+
5+
## Feature plugin and package inclusion in WooCommerce
6+
7+
### Display correct block template when filtering by attribute. ([7640](https://github.com/woocommerce/woocommerce-blocks/pull/7640))
8+
9+
#### Test that #7604 has been fixed
10+
11+
1. Make sure you have a block theme active (like Twenty Twenty-Three).
12+
2. Add the “Filter by Attribute” block to the “Products by Category” template (in Appearance > Site Editor).
13+
3. Go to the front-end for a category (ie: /product-category/clothing/).
14+
4. Select a filter.
15+
5. Verify the query params are added to the URL and the URL stays correct.
16+
6. Verify the loaded template is also correct (instead of rendering the “Product Catalog” template).
17+
18+
#### Test that there are no regressions with #6776
19+
20+
1. Make sure you have a block theme active (like Twenty Twenty-Three).
21+
2. Navigate to Products > Attributes and edit an existing one or create a new one.
22+
3. Click the Enable Archives option and save, go back.
23+
4. Click Configure terms next to your attribute.
24+
5. Hover over one of the terms and click the View link of one of the attributes.
25+
6. Verify that the page is rendered with a header, a footer, and using a product grid.

docs/internal-developers/testing/releases/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Every release includes specific testing instructions for new features and bug fi
102102
- [8.8.1](./881.md)
103103
- [8.8.2](./882.md)
104104
- [8.9.0](./890.md)
105+
- [8.9.1](./891.md)
105106

106107
<!-- FEEDBACK -->
107108

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@woocommerce/block-library",
33
"title": "WooCommerce Blocks",
44
"author": "Automattic",
5-
"version": "8.9.0",
5+
"version": "8.9.1",
66
"description": "WooCommerce blocks for the Gutenberg editor.",
77
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
88
"keywords": [

readme.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
44
Requires at least: 6.1
55
Tested up to: 6.1
66
Requires PHP: 7.0
7-
Stable tag: 8.9.0
7+
Stable tag: 8.9.1
88
License: GPLv3
99
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1010

@@ -79,6 +79,12 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/
7979

8080
== Changelog ==
8181

82+
= 8.9.1 - 2022-11-14 =
83+
84+
#### Bug fixes
85+
86+
- Display correct block template when filtering by attribute. ([7640](https://github.com/woocommerce/woocommerce-blocks/pull/7640))
87+
8288
= 8.9.0 - 2022-11-07 =
8389

8490
#### Enhancements

src/BlockTemplatesController.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,17 +426,24 @@ public function render_block_template() {
426426
$this->block_template_is_available( 'taxonomy-product_tag' )
427427
) {
428428
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
429-
} elseif ( taxonomy_is_product_attribute( get_query_var( 'taxonomy' ) ) &&
430-
! BlockTemplateUtils::theme_has_template( 'archive-product' ) &&
431-
$this->block_template_is_available( 'archive-product' )
432-
) {
433-
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
434429
} elseif (
435430
( is_post_type_archive( 'product' ) || is_page( wc_get_page_id( 'shop' ) ) ) &&
436431
! BlockTemplateUtils::theme_has_template( 'archive-product' ) &&
437432
$this->block_template_is_available( 'archive-product' )
438433
) {
439434
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
435+
} else {
436+
$queried_object = get_queried_object();
437+
if ( is_null( $queried_object ) ) {
438+
return;
439+
}
440+
441+
if ( isset( $queried_object->taxonomy ) && taxonomy_is_product_attribute( $queried_object->taxonomy ) &&
442+
! BlockTemplateUtils::theme_has_template( 'archive-product' ) &&
443+
$this->block_template_is_available( 'archive-product' )
444+
) {
445+
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
446+
}
440447
}
441448
}
442449

src/Package.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static function container( $reset = false ) {
109109
NewPackage::class,
110110
function ( $container ) {
111111
// leave for automated version bumping.
112-
$version = '8.9.0';
112+
$version = '8.9.1';
113113
return new NewPackage(
114114
$version,
115115
dirname( __DIR__ ),

src/Templates/ProductAttributeTemplate.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ protected function init() {
3030
* @param array $templates Templates that match the product attributes taxonomy.
3131
*/
3232
public function update_taxonomy_template_hierarchy( $templates ) {
33-
if ( taxonomy_is_product_attribute( get_query_var( 'taxonomy' ) ) && wc_current_theme_is_fse_theme() ) {
33+
$queried_object = get_queried_object();
34+
if ( taxonomy_is_product_attribute( $queried_object->taxonomy ) && wc_current_theme_is_fse_theme() ) {
3435
array_unshift( $templates, self::SLUG );
3536
}
3637

woocommerce-gutenberg-products-block.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WooCommerce Blocks
44
* Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
55
* Description: WooCommerce blocks for the Gutenberg editor.
6-
* Version: 8.9.0
6+
* Version: 8.9.1
77
* Author: Automattic
88
* Author URI: https://woocommerce.com
99
* Text Domain: woo-gutenberg-products-block

0 commit comments

Comments
 (0)