From aaff89b2eb915c03c72c5c02fc525d7f91a28de5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 17 Feb 2023 10:52:58 +0000 Subject: [PATCH 01/45] Empty commit for release pull request From 72cd6d2037a918e17cd8e2af6cdff083538f2f7c Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Fri, 17 Feb 2023 12:07:57 +0100 Subject: [PATCH 02/45] Add changelog to readme.txt --- readme.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/readme.txt b/readme.txt index ed0f997ec21..9dd86864aba 100644 --- a/readme.txt +++ b/readme.txt @@ -80,6 +80,14 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 9.6.1 - 2023-02-17 = + +#### Bug Fixes + +- Make Mini Cart Contents block visible in the Style Book. ([8458](https://github.com/woocommerce/woocommerce-blocks/pull/8458)) +- Fixed an issue where cart item data could cause fatal errors if it was an array. ([8440](https://github.com/woocommerce/woocommerce-blocks/pull/8440)) +- Fix Customer account sidebar link incorrect margin in WP 6.2. ([8437](https://github.com/woocommerce/woocommerce-blocks/pull/8437)) + = 9.6.0 - 2023-02-14 = #### Enhancements From d2c331de3e11f2fb67d2902249f528b324ef12f3 Mon Sep 17 00:00:00 2001 From: Seghir Nadir Date: Fri, 17 Feb 2023 14:46:10 +0100 Subject: [PATCH 03/45] Unset default customer state if it doesn't match country (#8460) * Unset default state * add controller for customers * rename validation file * explain fix inline * address feedback * revert back state logic * Update src/StoreApi/Utilities/ValidationUtils.php Co-authored-by: Mike Jolley --------- Co-authored-by: Mike Jolley --- src/StoreApi/Routes/V1/CartUpdateCustomer.php | 18 ++++- .../Schemas/V1/AbstractAddressSchema.php | 67 +++---------------- .../Schemas/V1/BillingAddressSchema.php | 4 +- .../Schemas/V1/ShippingAddressSchema.php | 4 +- src/StoreApi/Utilities/ValidationUtils.php | 61 +++++++++++++++++ 5 files changed, 93 insertions(+), 61 deletions(-) create mode 100644 src/StoreApi/Utilities/ValidationUtils.php diff --git a/src/StoreApi/Routes/V1/CartUpdateCustomer.php b/src/StoreApi/Routes/V1/CartUpdateCustomer.php index 330c9c1c573..264e3da6cc2 100644 --- a/src/StoreApi/Routes/V1/CartUpdateCustomer.php +++ b/src/StoreApi/Routes/V1/CartUpdateCustomer.php @@ -2,6 +2,7 @@ namespace Automattic\WooCommerce\StoreApi\Routes\V1; use Automattic\WooCommerce\StoreApi\Utilities\DraftOrderTrait; +use Automattic\WooCommerce\StoreApi\Utilities\ValidationUtils; /** * CartUpdateCustomer class. @@ -215,6 +216,19 @@ protected function get_route_post_response( \WP_REST_Request $request ) { * @return array */ protected function get_customer_billing_address( \WC_Customer $customer ) { + $validation_util = new ValidationUtils(); + $billing_country = $customer->get_billing_country(); + $billing_state = $customer->get_billing_state(); + + /** + * There's a bug in WooCommerce core in which not having a state ("") would result in us validating against the store's state. + * This resets the state to an empty string if it doesn't match the country. + * + * @todo Removing this handling once we fix the issue with the state value always being the store one. + */ + if ( ! $validation_util->validate_state( $billing_state, $billing_country ) ) { + $billing_state = ''; + } return [ 'first_name' => $customer->get_billing_first_name(), 'last_name' => $customer->get_billing_last_name(), @@ -222,9 +236,9 @@ protected function get_customer_billing_address( \WC_Customer $customer ) { 'address_1' => $customer->get_billing_address_1(), 'address_2' => $customer->get_billing_address_2(), 'city' => $customer->get_billing_city(), - 'state' => $customer->get_billing_state(), + 'state' => $billing_state, 'postcode' => $customer->get_billing_postcode(), - 'country' => $customer->get_billing_country(), + 'country' => $billing_country, 'phone' => $customer->get_billing_phone(), 'email' => $customer->get_billing_email(), ]; diff --git a/src/StoreApi/Schemas/V1/AbstractAddressSchema.php b/src/StoreApi/Schemas/V1/AbstractAddressSchema.php index cae085878d1..3d1e313b4a8 100644 --- a/src/StoreApi/Schemas/V1/AbstractAddressSchema.php +++ b/src/StoreApi/Schemas/V1/AbstractAddressSchema.php @@ -1,6 +1,8 @@ get_properties() ), '' ), (array) $address ); $address['country'] = wc_strtoupper( wc_clean( wp_unslash( $address['country'] ) ) ); $address['first_name'] = wc_clean( wp_unslash( $address['first_name'] ) ); @@ -95,64 +99,12 @@ public function sanitize_callback( $address, $request, $param ) { $address['address_1'] = wc_clean( wp_unslash( $address['address_1'] ) ); $address['address_2'] = wc_clean( wp_unslash( $address['address_2'] ) ); $address['city'] = wc_clean( wp_unslash( $address['city'] ) ); - $address['state'] = $this->format_state( wc_clean( wp_unslash( $address['state'] ) ), $address['country'] ); + $address['state'] = $validation_util->format_state( wc_clean( wp_unslash( $address['state'] ) ), $address['country'] ); $address['postcode'] = $address['postcode'] ? wc_format_postcode( wc_clean( wp_unslash( $address['postcode'] ) ), $address['country'] ) : ''; $address['phone'] = wc_clean( wp_unslash( $address['phone'] ) ); return $address; } - /** - * Get list of states for a country. - * - * @param string $country Country code. - * @return array Array of state names indexed by state keys. - */ - protected function get_states_for_country( $country ) { - return $country ? array_filter( (array) \wc()->countries->get_states( $country ) ) : []; - } - - /** - * Validate provided state against a countries list of defined states. - * - * If there are no defined states for a country, any given state is valid. - * - * @param string $state State name or code (sanitized). - * @param string $country Country code. - * @return boolean Valid or not valid. - */ - protected function validate_state( $state, $country ) { - $states = $this->get_states_for_country( $country ); - - if ( count( $states ) && ! in_array( \wc_strtoupper( $state ), array_map( '\wc_strtoupper', array_keys( $states ) ), true ) ) { - return false; - } - - return true; - } - - /** - * Format a state based on the country. If country has defined states, will return a valid upper case state code. - * - * @param string $state State name or code (sanitized). - * @param string $country Country code. - * @return string - */ - protected function format_state( $state, $country ) { - $states = $this->get_states_for_country( $country ); - - if ( count( $states ) ) { - $state = \wc_strtoupper( $state ); - $state_values = array_map( 'wc_strtoupper', array_flip( array_map( '\wc_strtoupper', $states ) ) ); - - if ( isset( $state_values[ $state ] ) ) { - // Convert to state code if a state name was provided. - return $state_values[ $state ]; - } - } - - return $state; - } - /** * Validate the given address object. * @@ -164,8 +116,9 @@ protected function format_state( $state, $country ) { * @return true|\WP_Error */ public function validate_callback( $address, $request, $param ) { - $errors = new \WP_Error(); - $address = $this->sanitize_callback( $address, $request, $param ); + $errors = new \WP_Error(); + $address = $this->sanitize_callback( $address, $request, $param ); + $validation_util = new ValidationUtils(); if ( ! empty( $address['country'] ) && ! in_array( $address['country'], array_keys( wc()->countries->get_countries() ), true ) ) { $errors->add( @@ -179,14 +132,14 @@ public function validate_callback( $address, $request, $param ) { return $errors; } - if ( ! empty( $address['state'] ) && ! $this->validate_state( $address['state'], $address['country'] ) ) { + if ( ! empty( $address['state'] ) && ! $validation_util->validate_state( $address['state'], $address['country'] ) ) { $errors->add( 'invalid_state', sprintf( /* translators: %1$s given state, %2$s valid states */ __( 'The provided state (%1$s) is not valid. Must be one of: %2$s', 'woo-gutenberg-products-block' ), esc_html( $address['state'] ), - implode( ', ', array_keys( $this->get_states_for_country( $address['country'] ) ) ) + implode( ', ', array_keys( $validation_util->get_states_for_country( $address['country'] ) ) ) ) ); } diff --git a/src/StoreApi/Schemas/V1/BillingAddressSchema.php b/src/StoreApi/Schemas/V1/BillingAddressSchema.php index ee750f0c9e5..0ae1ca68e56 100644 --- a/src/StoreApi/Schemas/V1/BillingAddressSchema.php +++ b/src/StoreApi/Schemas/V1/BillingAddressSchema.php @@ -2,6 +2,7 @@ namespace Automattic\WooCommerce\StoreApi\Schemas\V1; use Automattic\WooCommerce\StoreApi\Exceptions\RouteException; +use Automattic\WooCommerce\StoreApi\Utilities\ValidationUtils; /** * BillingAddressSchema class. @@ -89,11 +90,12 @@ public function validate_callback( $address, $request, $param ) { * @return stdClass */ public function get_item_response( $address ) { + $validation_util = new ValidationUtils(); if ( ( $address instanceof \WC_Customer || $address instanceof \WC_Order ) ) { $billing_country = $address->get_billing_country(); $billing_state = $address->get_billing_state(); - if ( ! $this->validate_state( $billing_state, $billing_country ) ) { + if ( ! $validation_util->validate_state( $billing_state, $billing_country ) ) { $billing_state = ''; } diff --git a/src/StoreApi/Schemas/V1/ShippingAddressSchema.php b/src/StoreApi/Schemas/V1/ShippingAddressSchema.php index 75ee619bb42..9a24f27844f 100644 --- a/src/StoreApi/Schemas/V1/ShippingAddressSchema.php +++ b/src/StoreApi/Schemas/V1/ShippingAddressSchema.php @@ -2,6 +2,7 @@ namespace Automattic\WooCommerce\StoreApi\Schemas\V1; use Automattic\WooCommerce\StoreApi\Exceptions\RouteException; +use Automattic\WooCommerce\StoreApi\Utilities\ValidationUtils; /** * ShippingAddressSchema class. @@ -32,11 +33,12 @@ class ShippingAddressSchema extends AbstractAddressSchema { * @return stdClass */ public function get_item_response( $address ) { + $validation_util = new ValidationUtils(); if ( ( $address instanceof \WC_Customer || $address instanceof \WC_Order ) ) { $shipping_country = $address->get_shipping_country(); $shipping_state = $address->get_shipping_state(); - if ( ! $this->validate_state( $shipping_state, $shipping_country ) ) { + if ( ! $validation_util->validate_state( $shipping_state, $shipping_country ) ) { $shipping_state = ''; } diff --git a/src/StoreApi/Utilities/ValidationUtils.php b/src/StoreApi/Utilities/ValidationUtils.php new file mode 100644 index 00000000000..1991b0ae65d --- /dev/null +++ b/src/StoreApi/Utilities/ValidationUtils.php @@ -0,0 +1,61 @@ +countries->get_states( $country ) ) : []; + } + + /** + * Validate provided state against a countries list of defined states. + * + * If there are no defined states for a country, any given state is valid. + * + * @param string $state State name or code (sanitized). + * @param string $country Country code. + * @return boolean Valid or not valid. + */ + public function validate_state( $state, $country ) { + $states = $this->get_states_for_country( $country ); + + if ( count( $states ) && ! in_array( \wc_strtoupper( $state ), array_map( '\wc_strtoupper', array_keys( $states ) ), true ) ) { + return false; + } + + return true; + } + + + /** + * Format a state based on the country. If country has defined states, will return a valid upper case state code. + * + * @param string $state State name or code (sanitized). + * @param string $country Country code. + * @return string + */ + public function format_state( $state, $country ) { + $states = $this->get_states_for_country( $country ); + + if ( count( $states ) ) { + $state = \wc_strtoupper( $state ); + $state_values = array_map( '\wc_strtoupper', array_flip( array_map( '\wc_strtoupper', $states ) ) ); + + if ( isset( $state_values[ $state ] ) ) { + // Convert to state code if a state name was provided. + return $state_values[ $state ]; + } + } + + return $state; + } +} From 274d1f5d4456c9b1cfdfb1634f5df39b83e6f624 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Fri, 17 Feb 2023 14:51:50 +0100 Subject: [PATCH 04/45] Update readme.txt --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 9dd86864aba..a98c370077d 100644 --- a/readme.txt +++ b/readme.txt @@ -87,6 +87,7 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ - Make Mini Cart Contents block visible in the Style Book. ([8458](https://github.com/woocommerce/woocommerce-blocks/pull/8458)) - Fixed an issue where cart item data could cause fatal errors if it was an array. ([8440](https://github.com/woocommerce/woocommerce-blocks/pull/8440)) - Fix Customer account sidebar link incorrect margin in WP 6.2. ([8437](https://github.com/woocommerce/woocommerce-blocks/pull/8437)) +- Fix cases in which Checkout would validate customer country against the wrong state. ([8460](https://github.com/woocommerce/woocommerce-blocks/pull/8460)) = 9.6.0 - 2023-02-14 = From 5619755043954c9890e405310139edcdb97c03d3 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Fri, 17 Feb 2023 14:59:47 +0100 Subject: [PATCH 05/45] Add testing notes --- .../testing/releases/961.md | 48 +++++++++++++++++++ .../testing/releases/README.md | 1 + 2 files changed, 49 insertions(+) create mode 100644 docs/internal-developers/testing/releases/961.md diff --git a/docs/internal-developers/testing/releases/961.md b/docs/internal-developers/testing/releases/961.md new file mode 100644 index 00000000000..aaefcc784fe --- /dev/null +++ b/docs/internal-developers/testing/releases/961.md @@ -0,0 +1,48 @@ +# Testing notes and ZIP for release 9.6.1 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10767439/woocommerce-gutenberg-products-block.zip) + +## WooCommerce Core + +### Make Mini Cart Contents block visible in the Style Book. ([8458](https://github.com/woocommerce/woocommerce-blocks/pull/8458)) + +1. With Gutenberg installed and a block theme like [Twenty Twenty-Three](https://wordpress.org/themes/twentytwentythree/) enabled. +2. Go to Appearance > Editor and edit a template. +3. In the toolbar, select Styles (black and white circle) and then, Open Style Book (eye icon). +4. Go to the WooCommerce tab. +5. Ensure the Mini Cart Contents block is visible. + +| Before | After | +| ------ | ----- | +| ![imatge](https://user-images.githubusercontent.com/3616980/219356399-cd2c16c1-4256-42e4-a59b-0a77d273ebc7.png) | ![imatge](https://user-images.githubusercontent.com/3616980/219356269-9cc6ece5-5f5f-4df9-8e57-dc158bcace8d.png) | + +### Fix Customer account sidebar link incorrect margin in WP 6.2. ([8437](https://github.com/woocommerce/woocommerce-blocks/pull/8437)) + +1. In WP 6.1 without Gutenberg installed, verify there are no regressions: +1.1. Add the Customer account block to a post or page. +1.2. In the editor, open the sidebar and verify the Manage account settings link is displayed below the product description. +2. In WP 6.2 or WP 6.1 with Gutenberg installed, verify the link has correct margins: +2.1. Add the Customer account block to a post or page. +1.2. In the editor, open the sidebar and verify the Manage account settings link has correct margins. + +· | WP 6.1 without GB enabled | WP 6.1 with GB enabled | +--- | --- | --- | +Before | ![imatge](https://user-images.githubusercontent.com/3616980/219014857-6071a40e-8770-4f1f-b37c-91e5bf7451b5.png) | ![imatge](https://user-images.githubusercontent.com/3616980/219015103-982b2663-a15a-4101-9f24-83478b0e6eea.png) | +After | ![imatge](https://user-images.githubusercontent.com/3616980/219014857-6071a40e-8770-4f1f-b37c-91e5bf7451b5.png) | ![imatge](https://user-images.githubusercontent.com/3616980/219014964-505597f7-2f52-42c8-91ad-04c130bfff78.png) | + +## Feature plugin + +### Fix cases in which Checkout would validate customer country against the wrong state. ([8460](https://github.com/woocommerce/woocommerce-blocks/pull/8460)) + +1. Set US/California as the default shipping destination. +2. Add a product to the cart. +3. Go to the checkout page. +4. Select a different Shipping Country that has states, e.g. Greece. +5. Fill in the city field. +6. You should not get a error. +7. Checkout without setting the state. +8. In the admin, you should not see California as the state. + +## Experimental + +n/a diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index e7c6c11aa9a..0e97e72169b 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -119,6 +119,7 @@ Every release includes specific testing instructions for new features and bug fi - [9.4.2](./942.md) - [9.5.0](./950.md) - [9.6.0](./960.md) + - [9.6.1](./961.md) From 820d272440c17dd053a5098da77defc5c0e81b92 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Fri, 17 Feb 2023 15:02:15 +0100 Subject: [PATCH 06/45] Update testing notes --- docs/internal-developers/testing/releases/961.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/internal-developers/testing/releases/961.md b/docs/internal-developers/testing/releases/961.md index aaefcc784fe..6ce643fd24f 100644 --- a/docs/internal-developers/testing/releases/961.md +++ b/docs/internal-developers/testing/releases/961.md @@ -30,8 +30,6 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. Before | ![imatge](https://user-images.githubusercontent.com/3616980/219014857-6071a40e-8770-4f1f-b37c-91e5bf7451b5.png) | ![imatge](https://user-images.githubusercontent.com/3616980/219015103-982b2663-a15a-4101-9f24-83478b0e6eea.png) | After | ![imatge](https://user-images.githubusercontent.com/3616980/219014857-6071a40e-8770-4f1f-b37c-91e5bf7451b5.png) | ![imatge](https://user-images.githubusercontent.com/3616980/219014964-505597f7-2f52-42c8-91ad-04c130bfff78.png) | -## Feature plugin - ### Fix cases in which Checkout would validate customer country against the wrong state. ([8460](https://github.com/woocommerce/woocommerce-blocks/pull/8460)) 1. Set US/California as the default shipping destination. @@ -43,6 +41,10 @@ After | ![imatge](https://user-images.githubusercontent.com/3616980/219014857-60 7. Checkout without setting the state. 8. In the admin, you should not see California as the state. +## Feature plugin + +n/a + ## Experimental n/a From bb1196d0655293cb8b689d713f17100cb0a57a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Thu, 16 Feb 2023 10:07:44 +0100 Subject: [PATCH 07/45] Fix Customer account sidebar link incorrect margin in WP 6.2 (#8437) * Fix Customer account sidebar link incorrect margin in WP 6.2 * Update class name to match the guidelines --- assets/js/blocks/customer-account/editor.scss | 7 ++++++- assets/js/blocks/customer-account/sidebar-settings.tsx | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/assets/js/blocks/customer-account/editor.scss b/assets/js/blocks/customer-account/editor.scss index 372755cab63..92974fb7555 100644 --- a/assets/js/blocks/customer-account/editor.scss +++ b/assets/js/blocks/customer-account/editor.scss @@ -2,6 +2,11 @@ width: 100%; } -.account-link { +/* In sidebar without tabs (WP <=6.1) */ +.block-editor-block-card + div > .wc-block-editor-customer-account__link { padding: 0 $gap $gap 52px; } +/* In tabbed sidebar (ie: WP >=6.2) */ +.wc-block-editor-customer-account__link { + padding: $gap; +} diff --git a/assets/js/blocks/customer-account/sidebar-settings.tsx b/assets/js/blocks/customer-account/sidebar-settings.tsx index 456dc3a8687..d58e8d28408 100644 --- a/assets/js/blocks/customer-account/sidebar-settings.tsx +++ b/assets/js/blocks/customer-account/sidebar-settings.tsx @@ -47,7 +47,11 @@ const AccountSettingsLink = () => { } ); - return
{ linkText }
; + return ( +
+ { linkText } +
+ ); }; export const BlockSettings = ( { From 0d06eab78b0bc4ec55cf531633b2b951904a26b3 Mon Sep 17 00:00:00 2001 From: Thomas Roberts <5656702+opr@users.noreply.github.com> Date: Thu, 16 Feb 2023 15:06:55 +0000 Subject: [PATCH 08/45] Prevent cart from breaking when item_data contains an array (#8440) * Ensure array item data is removed * Remove unused key * Clean up code and add comments * Check for null instead of empty * Use plain foreach to filter and map arrays --- src/StoreApi/Schemas/V1/CartItemSchema.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/StoreApi/Schemas/V1/CartItemSchema.php b/src/StoreApi/Schemas/V1/CartItemSchema.php index beb98b81d39..d61650b5ca7 100644 --- a/src/StoreApi/Schemas/V1/CartItemSchema.php +++ b/src/StoreApi/Schemas/V1/CartItemSchema.php @@ -458,8 +458,20 @@ protected function get_item_data( $cart_item ) { * @param array $cart_item Cart item array. * @return array */ - $item_data = apply_filters( 'woocommerce_get_item_data', array(), $cart_item ); - return array_map( [ $this, 'format_item_data_element' ], $item_data ); + $item_data = apply_filters( 'woocommerce_get_item_data', array(), $cart_item ); + $clean_item_data = []; + foreach ( $item_data as $data ) { + // We will check each piece of data in the item data element to ensure it is scalar. Extensions could add arrays + // to this, which would cause a fatal in wp_strip_all_tags. If it is not scalar, we will return an empty array, + // which will be filtered out in get_item_data (after this function has run). + foreach ( $data as $data_value ) { + if ( ! is_scalar( $data_value ) ) { + continue 2; + } + } + $clean_item_data[] = $this->format_item_data_element( $data ); + } + return $clean_item_data; } /** From 7e53f1b49f83d4e89f59939fcfbd65e03665d0f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Fri, 17 Feb 2023 11:45:42 +0100 Subject: [PATCH 09/45] Add minimum height to Mini Cart Contents block in the Style Book (#8458) --- assets/js/blocks/mini-cart/mini-cart-contents/editor.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/js/blocks/mini-cart/mini-cart-contents/editor.scss b/assets/js/blocks/mini-cart/mini-cart-contents/editor.scss index 115cfe12a0b..4a4812348cc 100644 --- a/assets/js/blocks/mini-cart/mini-cart-contents/editor.scss +++ b/assets/js/blocks/mini-cart/mini-cart-contents/editor.scss @@ -79,3 +79,9 @@ color: currentColor; } } + +.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents, +.editor-styles-wrapper .wp-block-woocommerce-filled-mini-cart-contents-block { + height: auto; + min-height: 500px; +} From 77191a13677b7ed7b97bf3d6c8a71497eb74e604 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Fri, 17 Feb 2023 15:34:26 +0100 Subject: [PATCH 10/45] Update testing notes zip file --- docs/internal-developers/testing/releases/961.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/961.md b/docs/internal-developers/testing/releases/961.md index 6ce643fd24f..12eeb880432 100644 --- a/docs/internal-developers/testing/releases/961.md +++ b/docs/internal-developers/testing/releases/961.md @@ -1,6 +1,6 @@ # Testing notes and ZIP for release 9.6.1 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10767439/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10767768/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core From 451206bb3373bd0960b81b430409318ca051415b Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Fri, 17 Feb 2023 15:42:39 +0100 Subject: [PATCH 11/45] Update testing notes --- docs/internal-developers/testing/releases/961.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/internal-developers/testing/releases/961.md b/docs/internal-developers/testing/releases/961.md index 12eeb880432..e94f11f910c 100644 --- a/docs/internal-developers/testing/releases/961.md +++ b/docs/internal-developers/testing/releases/961.md @@ -19,11 +19,11 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. ### Fix Customer account sidebar link incorrect margin in WP 6.2. ([8437](https://github.com/woocommerce/woocommerce-blocks/pull/8437)) 1. In WP 6.1 without Gutenberg installed, verify there are no regressions: -1.1. Add the Customer account block to a post or page. -1.2. In the editor, open the sidebar and verify the Manage account settings link is displayed below the product description. + 1. Add the Customer account block to a post or page. + 2. In the editor, open the sidebar and verify the Manage account settings link is displayed below the product description. 2. In WP 6.2 or WP 6.1 with Gutenberg installed, verify the link has correct margins: -2.1. Add the Customer account block to a post or page. -1.2. In the editor, open the sidebar and verify the Manage account settings link has correct margins. + 1. Add the Customer account block to a post or page. + 2. In the editor, open the sidebar and verify the Manage account settings link has correct margins. · | WP 6.1 without GB enabled | WP 6.1 with GB enabled | --- | --- | --- | From 4e25673ef3294e9eb92d08d639c2d4c91674de0e Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Fri, 17 Feb 2023 15:53:43 +0100 Subject: [PATCH 12/45] Update testing notes file --- docs/internal-developers/testing/releases/961.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/internal-developers/testing/releases/961.md b/docs/internal-developers/testing/releases/961.md index e94f11f910c..e27796933dc 100644 --- a/docs/internal-developers/testing/releases/961.md +++ b/docs/internal-developers/testing/releases/961.md @@ -40,11 +40,3 @@ After | ![imatge](https://user-images.githubusercontent.com/3616980/219014857-60 6. You should not get a error. 7. Checkout without setting the state. 8. In the admin, you should not see California as the state. - -## Feature plugin - -n/a - -## Experimental - -n/a From 0167d46f5488f35d8c5ebfcc1626ae0ff2a4793c Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Fri, 17 Feb 2023 15:57:16 +0100 Subject: [PATCH 13/45] Bumping version strings to new version. --- package.json | 2 +- readme.txt | 2 +- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 01d54c1c301..330ae83f8b2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "9.6.0", + "version": "9.6.1", "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 a98c370077d..9795b423ce3 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 6.1.1 Tested up to: 6.1.1 Requires PHP: 7.2 -Stable tag: 9.6.0 +Stable tag: 9.6.1 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/src/Package.php b/src/Package.php index 759d0584b0e..c04f1996334 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 = '9.6.0'; + $version = '9.6.1'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index 079b9d17df8..ae036974c1c 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: 9.6.0 + * Version: 9.6.1 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block From 7da51a24e29e13fb1dbaa4f8d83e377897bb7713 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 22 Feb 2023 11:46:03 +0000 Subject: [PATCH 14/45] Empty commit for release pull request From a4971ed85689e9466d87d5cade6b37e6aaf3a2d4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 22 Feb 2023 11:52:28 +0000 Subject: [PATCH 15/45] Empty commit for release pull request From 04c30059c2ab8cf82c72281b84b2db303cfb0c1f Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Wed, 22 Feb 2023 14:16:04 +0100 Subject: [PATCH 16/45] disable compatibilty layer (#8507) --- src/BlockTemplatesController.php | 9 --------- src/Domain/Bootstrap.php | 8 -------- 2 files changed, 17 deletions(-) diff --git a/src/BlockTemplatesController.php b/src/BlockTemplatesController.php index 0e48bab5527..bb386149eee 100644 --- a/src/BlockTemplatesController.php +++ b/src/BlockTemplatesController.php @@ -2,7 +2,6 @@ namespace Automattic\WooCommerce\Blocks; use Automattic\WooCommerce\Blocks\Domain\Package; -use Automattic\WooCommerce\Blocks\Templates\BlockTemplatesCompatibility; use Automattic\WooCommerce\Blocks\Templates\ProductAttributeTemplate; use Automattic\WooCommerce\Blocks\Utils\BlockTemplateUtils; @@ -324,14 +323,6 @@ function( $template ) { $template->description = BlockTemplateUtils::get_block_template_description( $template->slug ); } - if ( 'single-product' === $template->slug ) { - if ( ! is_admin() ) { - $new_content = BlockTemplatesCompatibility::wrap_single_product_template( $template->content ); - $template->content = $new_content; - } - return $template; - } - return $template; }, $query_result diff --git a/src/Domain/Bootstrap.php b/src/Domain/Bootstrap.php index c42d39028a2..4c4fb45650c 100644 --- a/src/Domain/Bootstrap.php +++ b/src/Domain/Bootstrap.php @@ -22,7 +22,6 @@ use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry; use Automattic\WooCommerce\Blocks\Registry\Container; use Automattic\WooCommerce\Blocks\Templates\ClassicTemplatesCompatibility; -use Automattic\WooCommerce\Blocks\Templates\BlockTemplatesCompatibility; use Automattic\WooCommerce\Blocks\Templates\ProductAttributeTemplate; use Automattic\WooCommerce\Blocks\Templates\ProductSearchResultsTemplate; use Automattic\WooCommerce\StoreApi\RoutesController; @@ -128,7 +127,6 @@ function() { $this->container->get( ProductSearchResultsTemplate::class ); $this->container->get( ProductAttributeTemplate::class ); $this->container->get( ClassicTemplatesCompatibility::class ); - $this->container->get( BlockTemplatesCompatibility::class ); $this->container->get( BlockPatterns::class ); $this->container->get( PaymentsApi::class ); $this->container->get( ShippingController::class )->init(); @@ -274,12 +272,6 @@ function ( Container $container ) { return new ClassicTemplatesCompatibility( $asset_data_registry ); } ); - $this->container->register( - BlockTemplatesCompatibility::class, - function () { - return new BlockTemplatesCompatibility(); - } - ); $this->container->register( DraftOrders::class, function( Container $container ) { From 9bdd5369835e0979f7a0b1abf76580812a450918 Mon Sep 17 00:00:00 2001 From: Luigi Date: Wed, 22 Feb 2023 14:22:08 +0100 Subject: [PATCH 17/45] update changelog and testing instructions --- docs/internal-developers/testing/releases/962.md | 12 ++++++++++++ docs/internal-developers/testing/releases/README.md | 2 ++ readme.txt | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100644 docs/internal-developers/testing/releases/962.md diff --git a/docs/internal-developers/testing/releases/962.md b/docs/internal-developers/testing/releases/962.md new file mode 100644 index 00000000000..9fc6a1cdc70 --- /dev/null +++ b/docs/internal-developers/testing/releases/962.md @@ -0,0 +1,12 @@ +# Testing notes and ZIP for release 9.6.1 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10767768/woocommerce-gutenberg-products-block.zip) + +## WooCommerce Core + +### Disable compatibility layer. ([8507](https://github.com/woocommerce/woocommerce-blocks/pull/8507)) + +1. With the [Twenty Twenty-Three](https://wordpress.org/themes/twentytwentythree/) theme installed, go to `Appearance » Editor`. +2. Edit the Product Catalog template, adding the Products block above the WooCommerce Product Grid Block. +3. Save. +4. Go to the front end and verify that the `WooCommerce Product Grid Block` is visible. diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index 0e97e72169b..bb0227d9170 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -120,6 +120,8 @@ Every release includes specific testing instructions for new features and bug fi - [9.5.0](./950.md) - [9.6.0](./960.md) - [9.6.1](./961.md) + - [9.6.2](./962.md) + diff --git a/readme.txt b/readme.txt index 9795b423ce3..4d4b67b0572 100644 --- a/readme.txt +++ b/readme.txt @@ -80,6 +80,12 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 9.6.2 - 2023-02-22 = + +#### Bug Fixes + +- Disable compatibility layer ([8507](https://github.com/woocommerce/woocommerce-blocks/pull/8507)) + = 9.6.1 - 2023-02-17 = #### Bug Fixes From 65663da193b5f89ac874e9fec5ebc276cced1c75 Mon Sep 17 00:00:00 2001 From: Luigi Date: Wed, 22 Feb 2023 14:31:05 +0100 Subject: [PATCH 18/45] add zip link --- docs/internal-developers/testing/releases/962.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/internal-developers/testing/releases/962.md b/docs/internal-developers/testing/releases/962.md index 9fc6a1cdc70..46897d4dda2 100644 --- a/docs/internal-developers/testing/releases/962.md +++ b/docs/internal-developers/testing/releases/962.md @@ -1,6 +1,7 @@ -# Testing notes and ZIP for release 9.6.1 +# Testing notes and ZIP for release 9.6.2 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10804236/woocommerce-gutenberg-products-block.zip) -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10767768/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core From 06ab47098a7d3bcb37e87042effb2935a7fbf3d3 Mon Sep 17 00:00:00 2001 From: Luigi Date: Wed, 22 Feb 2023 14:56:11 +0100 Subject: [PATCH 19/45] Bumping version strings to new version. --- package.json | 2 +- readme.txt | 2 +- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 330ae83f8b2..9b189182276 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "9.6.1", + "version": "9.6.2", "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 4d4b67b0572..f93191866b8 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 6.1.1 Tested up to: 6.1.1 Requires PHP: 7.2 -Stable tag: 9.6.1 +Stable tag: 9.6.2 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/src/Package.php b/src/Package.php index c04f1996334..00e1af36f1e 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 = '9.6.1'; + $version = '9.6.2'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index ae036974c1c..ad996c8c3df 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: 9.6.1 + * Version: 9.6.2 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block From 17dde6e8edefa50cb26294639d39214c1eb50a37 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 27 Feb 2023 11:16:30 +0000 Subject: [PATCH 20/45] Empty commit for release pull request From 1f86c53fe02e493856aa887994cd89fdbb50aa94 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 27 Feb 2023 11:19:19 +0000 Subject: [PATCH 21/45] Empty commit for release pull request From 25cdf1503b4d50c3637fc0b4314273fc358995b4 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Mon, 27 Feb 2023 12:31:38 +0100 Subject: [PATCH 22/45] Add changelog in readme.txt --- readme.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/readme.txt b/readme.txt index f93191866b8..d9f43f45ed0 100644 --- a/readme.txt +++ b/readme.txt @@ -80,6 +80,14 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 9.6.3 - 2023-02-27 = + +#### Bug Fixes + +- Fix: Ensure that Express Payment buttons are visible next to each other. ([8548](https://github.com/woocommerce/woocommerce-blocks/pull/8548)) +- Check if session is set before returning updated customer address. ([8537](https://github.com/woocommerce/woocommerce-blocks/pull/8537)) +- Fix the Checkout Blocks "Payment Options" settings crash in the editor. ([8535](https://github.com/woocommerce/woocommerce-blocks/pull/8535)) + = 9.6.2 - 2023-02-22 = #### Bug Fixes From 847a3b523d7e54a74502be4f7f7fd1bfe5a61f23 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Mon, 27 Feb 2023 12:44:52 +0100 Subject: [PATCH 23/45] Add testing notes --- .../testing/releases/963.md | 31 +++++++++++++++++++ .../testing/releases/README.md | 1 + 2 files changed, 32 insertions(+) create mode 100644 docs/internal-developers/testing/releases/963.md diff --git a/docs/internal-developers/testing/releases/963.md b/docs/internal-developers/testing/releases/963.md new file mode 100644 index 00000000000..ec7b59ea8ce --- /dev/null +++ b/docs/internal-developers/testing/releases/963.md @@ -0,0 +1,31 @@ +# Testing notes and ZIP for release 9.6.3 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10839270/woocommerce-gutenberg-products-block.zip) + + +## WooCommerce Core + +### Check if session is set before returning updated customer address. ([8537](https://github.com/woocommerce/woocommerce-blocks/pull/8537)) + +1. Install [AvaTax](https://woocommerce.com/products/woocommerce-avatax/) (credentials in secret 7715) and set it up so taxes are applied to your orders. I used a store in the USA and used USA addresses. +2. Install WooCommerce Subscriptions +3. Create a Subscription product and add it to your cart. Then check out. +4. Open the **subscription** in the WP dashboard, and from the subscription actions box, choose "Process renewal" +5. image +6. There is no error, and the sum is correct + +### Fix the Checkout Blocks "Payment Options" settings crash in the editor. ([8535](https://github.com/woocommerce/woocommerce-blocks/pull/8535)) + +1. Install and enable an incompatible payment gateway plugin with the `Cart` & `Checkout` Blocks. (e.g., [IDPay Payment Gateway for Woocommerce](https://wordpress.org/plugins/woo-idpay-gateway/)) +2. Create a new page and add the `Checkout` Block +3. Select the Checkout Block or any of its Inner Blocks (except for the `Payment Options` Inner Block). Ensure our incompatible payment gateway (e.g., IDPay) is listed under the incompatible gateways notice: + +image + +4. Select the `Payment Options` Inner Block. Ensure its settings are correctly displayed, the incompatible gateways notice is showing and our incompatible payment Gateway is highlighted under `Settings -> Block -> Methods` + +image + +| Before | After | +| ------ | ----- | +| image | image | diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index bb0227d9170..0b38a5033c7 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -121,6 +121,7 @@ Every release includes specific testing instructions for new features and bug fi - [9.6.0](./960.md) - [9.6.1](./961.md) - [9.6.2](./962.md) + - [9.6.3](./963.md) From 9e5d479d2ac25dd2521bbe201afd15ac15354588 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Mon, 27 Feb 2023 16:02:10 +0100 Subject: [PATCH 24/45] Remove change from testing notes This requires AvaTax credentials for testing. So, we'll test for regressions instead --- docs/internal-developers/testing/releases/963.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/internal-developers/testing/releases/963.md b/docs/internal-developers/testing/releases/963.md index ec7b59ea8ce..868bc894008 100644 --- a/docs/internal-developers/testing/releases/963.md +++ b/docs/internal-developers/testing/releases/963.md @@ -5,15 +5,6 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. ## WooCommerce Core -### Check if session is set before returning updated customer address. ([8537](https://github.com/woocommerce/woocommerce-blocks/pull/8537)) - -1. Install [AvaTax](https://woocommerce.com/products/woocommerce-avatax/) (credentials in secret 7715) and set it up so taxes are applied to your orders. I used a store in the USA and used USA addresses. -2. Install WooCommerce Subscriptions -3. Create a Subscription product and add it to your cart. Then check out. -4. Open the **subscription** in the WP dashboard, and from the subscription actions box, choose "Process renewal" -5. image -6. There is no error, and the sum is correct - ### Fix the Checkout Blocks "Payment Options" settings crash in the editor. ([8535](https://github.com/woocommerce/woocommerce-blocks/pull/8535)) 1. Install and enable an incompatible payment gateway plugin with the `Cart` & `Checkout` Blocks. (e.g., [IDPay Payment Gateway for Woocommerce](https://wordpress.org/plugins/woo-idpay-gateway/)) From 82a115e3b13bcf6a7d66d5acdbf9ab89da484067 Mon Sep 17 00:00:00 2001 From: Seghir Nadir Date: Fri, 24 Feb 2023 15:53:11 +0100 Subject: [PATCH 25/45] Check for null session before going forward (#8537) --- src/Shipping/ShippingController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Shipping/ShippingController.php b/src/Shipping/ShippingController.php index 2a20b91ea31..9735f04cc16 100644 --- a/src/Shipping/ShippingController.php +++ b/src/Shipping/ShippingController.php @@ -283,6 +283,10 @@ public function flush_cache( $settings ) { * @return array */ public function filter_taxable_address( $address ) { + + if ( null === WC()->session ) { + return $address; + } // We only need to select from the first package, since pickup_location only supports a single package. $chosen_method = current( WC()->session->get( 'chosen_shipping_methods', array() ) ) ?? ''; $chosen_method_id = explode( ':', $chosen_method )[0]; From 0e6db975ddade763564dcbf63e3afcccc9097e80 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Fri, 24 Feb 2023 16:08:19 +0100 Subject: [PATCH 26/45] Fix Payment Options settings crash in the editor (#8535) --- assets/js/editor-components/external-link-card/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/editor-components/external-link-card/index.tsx b/assets/js/editor-components/external-link-card/index.tsx index 21c57081aca..3b0495cbf4f 100644 --- a/assets/js/editor-components/external-link-card/index.tsx +++ b/assets/js/editor-components/external-link-card/index.tsx @@ -5,7 +5,7 @@ import { __ } from '@wordpress/i18n'; import { Icon, external } from '@wordpress/icons'; import { VisuallyHidden } from '@wordpress/components'; import { sanitizeHTML } from '@woocommerce/utils'; -import { alert } from '@woocommerce/icons'; +import { Alert } from '@woocommerce/icons'; /** * Internal dependencies @@ -50,7 +50,7 @@ const ExternalLinkCard = ( { ) } { warning ? ( - + } /> { warning } ) : null } From 2fae7679da50580633d34857e79d5d2017bdfbb9 Mon Sep 17 00:00:00 2001 From: Niels Lange Date: Mon, 27 Feb 2023 17:30:22 +0700 Subject: [PATCH 27/45] Ensure express payment buttons are visible next to each other (#8548) --- .../payment-methods/express-payment/style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss b/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss index 17fb4cb709c..5a4c67f7e64 100644 --- a/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss +++ b/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss @@ -88,6 +88,7 @@ $border-radius: 5px; .wc-block-components-express-payment__event-buttons { > li { + box-sizing: border-box; display: inline-block; width: 50%; } From a5a6092562e13d07d707e5985fc87fead8fd2262 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Mon, 27 Feb 2023 16:15:04 +0100 Subject: [PATCH 28/45] Update ZIP file --- docs/internal-developers/testing/releases/963.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/963.md b/docs/internal-developers/testing/releases/963.md index 868bc894008..de101bb3fd9 100644 --- a/docs/internal-developers/testing/releases/963.md +++ b/docs/internal-developers/testing/releases/963.md @@ -1,6 +1,6 @@ # Testing notes and ZIP for release 9.6.3 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10839270/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10841107/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core From 9619c92c052634dc8a247b4d205236c175c2b929 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Mon, 27 Feb 2023 18:19:45 +0100 Subject: [PATCH 29/45] Bumping version strings to new version. --- package.json | 2 +- readme.txt | 2 +- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9b189182276..23af53a13ce 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "9.6.2", + "version": "9.6.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 d9f43f45ed0..45bfd18c2b3 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 6.1.1 Tested up to: 6.1.1 Requires PHP: 7.2 -Stable tag: 9.6.2 +Stable tag: 9.6.3 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/src/Package.php b/src/Package.php index 00e1af36f1e..31c1a1848f7 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 = '9.6.2'; + $version = '9.6.3'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index ad996c8c3df..beb66ba0762 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: 9.6.2 + * Version: 9.6.3 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block From 659ec05101b0212a72ea7941dbcdd8778fc673cb Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 3 Mar 2023 09:23:09 +0000 Subject: [PATCH 30/45] Empty commit for release pull request From e5dcc910263c9afb6440998cb0c8c2f50a84a2d4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 3 Mar 2023 09:24:29 +0000 Subject: [PATCH 31/45] Empty commit for release pull request From f9bac1a189b5f0f3c44e1d81f38859d08b244fe2 Mon Sep 17 00:00:00 2001 From: Niels Lange Date: Fri, 3 Mar 2023 16:31:41 +0700 Subject: [PATCH 32/45] Update readme.txt --- readme.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/readme.txt b/readme.txt index 45bfd18c2b3..2495b1cf016 100644 --- a/readme.txt +++ b/readme.txt @@ -80,6 +80,12 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 9.6.4 - 2023-03-03 = + +#### Bug Fixes + +- Fix: Show up to three Express Payments buttons next to each other. ([8601](https://github.com/woocommerce/woocommerce-blocks/pull/8601)) + = 9.6.3 - 2023-02-27 = #### Bug Fixes From 09376f3c5ea14de54edccca76a29f4badffc8944 Mon Sep 17 00:00:00 2001 From: Niels Lange Date: Fri, 3 Mar 2023 16:32:25 +0700 Subject: [PATCH 33/45] Show three Express Payments buttons in-line (#8601) --- .../express-payment/style.scss | 36 ++++++------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss b/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss index 5a4c67f7e64..990809e7fac 100644 --- a/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss +++ b/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/style.scss @@ -7,9 +7,10 @@ $border-radius: 5px; .wc-block-components-express-payment__event-buttons { list-style: none; - display: flex; - flex-direction: row; - flex-wrap: wrap; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(calc(33% - 10px), 1fr)); + grid-gap: 10px; + box-sizing: border-box; width: 100%; padding: 0; margin: 0; @@ -18,6 +19,7 @@ $border-radius: 5px; > li { margin: 0; + width: 100%; > img { width: 100%; @@ -25,6 +27,12 @@ $border-radius: 5px; } } } + + @include breakpoint("<782px") { + .wc-block-components-express-payment__event-buttons { + grid-template-columns: 1fr; + } + } } .wc-block-components-express-payment--checkout { @@ -85,28 +93,6 @@ $border-radius: 5px; margin-bottom: em($gap); } } - - .wc-block-components-express-payment__event-buttons { - > li { - box-sizing: border-box; - display: inline-block; - width: 50%; - } - - > li:nth-child(even) { - padding-left: $gap-smaller; - } - - > li:nth-child(odd) { - padding-right: $gap-smaller; - } - - > li:only-child { - display: block; - width: 100%; - padding: 0; - } - } } .wc-block-components-express-payment--cart { From ab75621a76ba22e992675cd3038a32582d43ccdd Mon Sep 17 00:00:00 2001 From: Niels Lange Date: Fri, 3 Mar 2023 16:34:11 +0700 Subject: [PATCH 34/45] Add testing notes --- docs/internal-developers/testing/releases/964.md | 3 +++ docs/internal-developers/testing/releases/README.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docs/internal-developers/testing/releases/964.md diff --git a/docs/internal-developers/testing/releases/964.md b/docs/internal-developers/testing/releases/964.md new file mode 100644 index 00000000000..f1e5b9f78df --- /dev/null +++ b/docs/internal-developers/testing/releases/964.md @@ -0,0 +1,3 @@ +# Testing notes and ZIP for release 9.6.4 + +No User Facing Testing required with this patch release. diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index 0b38a5033c7..cff022b1a3c 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -122,7 +122,7 @@ Every release includes specific testing instructions for new features and bug fi - [9.6.1](./961.md) - [9.6.2](./962.md) - [9.6.3](./963.md) - + - [9.6.4](./964.md) From c3a273555226cb88e28819921cd1f7d8a53921d1 Mon Sep 17 00:00:00 2001 From: Niels Lange Date: Fri, 3 Mar 2023 17:16:46 +0700 Subject: [PATCH 35/45] Bumping version strings to new version. --- package.json | 2 +- readme.txt | 2 +- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 23af53a13ce..3ce52273f03 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "9.6.3", + "version": "9.6.4", "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 2495b1cf016..92484612466 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 6.1.1 Tested up to: 6.1.1 Requires PHP: 7.2 -Stable tag: 9.6.3 +Stable tag: 9.6.4 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/src/Package.php b/src/Package.php index 31c1a1848f7..f2bcd1ef80a 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 = '9.6.3'; + $version = '9.6.4'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index beb66ba0762..714b3642218 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: 9.6.3 + * Version: 9.6.4 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block From 2c8c780b6830aa7d9cca477e51b8973d51ae72bf Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 3 Mar 2023 10:24:09 +0000 Subject: [PATCH 36/45] Empty commit for release pull request From 3fedeb34738bf668a91abc820fd6b40814df212e Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 6 Mar 2023 14:50:48 +0000 Subject: [PATCH 37/45] Empty commit for release pull request From 4e9d51e50e96f523920f6f9e26abd96ffd31e430 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Mon, 6 Mar 2023 16:01:22 +0100 Subject: [PATCH 38/45] Add changelog in readme.txt --- readme.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/readme.txt b/readme.txt index 92484612466..b9a6e4e30b1 100644 --- a/readme.txt +++ b/readme.txt @@ -80,6 +80,12 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 9.6.5 - 2023-03-06 = + +#### Bug Fixes + +- Checkout: Fix state validation after changing shipping country. ([8633](https://github.com/woocommerce/woocommerce-blocks/pull/8633) + = 9.6.4 - 2023-03-03 = #### Bug Fixes From 348c3de099afa450cfabb6b05f5ecff617268794 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 6 Mar 2023 15:05:38 +0000 Subject: [PATCH 39/45] Undo dirty prop removal on error (#8633) Co-authored-by: Saad Tarhi --- assets/js/data/cart/push-changes.ts | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/assets/js/data/cart/push-changes.ts b/assets/js/data/cart/push-changes.ts index 85373cf9e88..8410a3a0a70 100644 --- a/assets/js/data/cart/push-changes.ts +++ b/assets/js/data/cart/push-changes.ts @@ -126,7 +126,6 @@ const dirtyProps = < const updateCustomerData = debounce( (): void => { const { billingAddress, shippingAddress } = customerData; const validationStore = select( VALIDATION_STORE_KEY ); - const customerDataToUpdate = {} as Partial< BillingAddressShippingAddress >; // Before we push anything, we need to ensure that the data we're pushing (dirty fields) are valid, otherwise we will // abort and wait for the validation issues to be resolved. @@ -150,6 +149,8 @@ const updateCustomerData = debounce( (): void => { } // Find valid data from the list of dirtyProps and prepare to push to the server. + const customerDataToUpdate = {} as Partial< BillingAddressShippingAddress >; + if ( dirtyProps.billingAddress.length ) { customerDataToUpdate.billing_address = pick( billingAddress, @@ -166,14 +167,31 @@ const updateCustomerData = debounce( (): void => { dirtyProps.shippingAddress = []; } + // If there is customer data to update, push it to the server. if ( Object.keys( customerDataToUpdate ).length ) { dispatch( STORE_KEY ) .updateCustomerData( customerDataToUpdate ) - .then( () => { - removeAllNotices(); - } ) + .then( removeAllNotices ) .catch( ( response ) => { processErrorResponse( response ); + + // Data did not persist due to an error. Make the props dirty again so they get pushed to the server. + if ( customerDataToUpdate.billing_address ) { + dirtyProps.billingAddress = [ + ...dirtyProps.billingAddress, + ...( Object.keys( + customerDataToUpdate.billing_address + ) as BaseAddressKey[] ), + ]; + } + if ( customerDataToUpdate.shipping_address ) { + dirtyProps.shippingAddress = [ + ...dirtyProps.shippingAddress, + ...( Object.keys( + customerDataToUpdate.shipping_address + ) as BaseAddressKey[] ), + ]; + } } ); } }, 1000 ); From cb14bc9937d641da52bb1b382e2c8c4732c4420b Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Mon, 6 Mar 2023 16:14:49 +0100 Subject: [PATCH 40/45] Add testing notes --- docs/internal-developers/testing/releases/965.md | 13 +++++++++++++ docs/internal-developers/testing/releases/README.md | 1 + 2 files changed, 14 insertions(+) create mode 100644 docs/internal-developers/testing/releases/965.md diff --git a/docs/internal-developers/testing/releases/965.md b/docs/internal-developers/testing/releases/965.md new file mode 100644 index 00000000000..bbaf048d576 --- /dev/null +++ b/docs/internal-developers/testing/releases/965.md @@ -0,0 +1,13 @@ +# Testing notes and ZIP for release 9.6.5 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10899628/woocommerce-gutenberg-products-block.zip) + + +## WooCommerce Core + +### Checkout: Fix state validation after changing shipping country. ([8633](https://github.com/woocommerce/woocommerce-blocks/pull/8633) + +1. With a default valid US shipping address set, add an item to the cart and proceed to checkout. +2. Change the shipping address country to India. You will see an error about the incorrect postcode. +3. Select an India state from the dropdown. You will see an error about the incorrect postcode. +4. Enter a valid postcode `411014`. All errors should go away. diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index cff022b1a3c..26ac363cb79 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -123,6 +123,7 @@ Every release includes specific testing instructions for new features and bug fi - [9.6.2](./962.md) - [9.6.3](./963.md) - [9.6.4](./964.md) + - [9.6.5](./965.md) From 001208300b1775ca42d20ab991fe0f86568085b8 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Thu, 16 Feb 2023 10:05:13 +0100 Subject: [PATCH 41/45] fix 404 error (#8445) --- src/BlockTypes/ProductImageGallery.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/BlockTypes/ProductImageGallery.php b/src/BlockTypes/ProductImageGallery.php index 43e84ebbe32..93300d21fcb 100644 --- a/src/BlockTypes/ProductImageGallery.php +++ b/src/BlockTypes/ProductImageGallery.php @@ -1,9 +1,6 @@ Date: Fri, 17 Mar 2023 13:27:28 +0000 Subject: [PATCH 42/45] Empty commit for release pull request From 5438fbe4391c4957a637e96caf3ab081eba6fa76 Mon Sep 17 00:00:00 2001 From: Luigi Date: Fri, 17 Mar 2023 14:31:10 +0100 Subject: [PATCH 43/45] add testing instruction --- docs/internal-developers/testing/releases/966.md | 14 ++++++++++++++ .../internal-developers/testing/releases/README.md | 1 + readme.txt | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100644 docs/internal-developers/testing/releases/966.md diff --git a/docs/internal-developers/testing/releases/966.md b/docs/internal-developers/testing/releases/966.md new file mode 100644 index 00000000000..b5368f601a9 --- /dev/null +++ b/docs/internal-developers/testing/releases/966.md @@ -0,0 +1,14 @@ +# Testing notes and ZIP for release 9.6.6 + +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10899628/woocommerce-gutenberg-products-block.zip) + + +## WooCommerce Core + +### Product Image Gallery: fix 404 error. ([8445](https://github.com/woocommerce/woocommerce-blocks/pull/8445) + +1. Go to Site Editor. +2. Check the network and see that any 404 error is visible. +3. Open the Single Product template. +4. Add the Product Image Gallery. +5. Be sure that it is visible on the front end. diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md index 26ac363cb79..4448b3cfcab 100644 --- a/docs/internal-developers/testing/releases/README.md +++ b/docs/internal-developers/testing/releases/README.md @@ -124,6 +124,7 @@ Every release includes specific testing instructions for new features and bug fi - [9.6.3](./963.md) - [9.6.4](./964.md) - [9.6.5](./965.md) + - [9.6.6](./965.md) diff --git a/readme.txt b/readme.txt index b9a6e4e30b1..60646f2ee20 100644 --- a/readme.txt +++ b/readme.txt @@ -80,6 +80,12 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/ == Changelog == += 9.6.6 - 2023-03-17 = + +#### Bug Fixes + +- Product Image Gallery: fix 404 error. ([8445](https://github.com/woocommerce/woocommerce-blocks/pull/8445)) + = 9.6.5 - 2023-03-06 = #### Bug Fixes From 98d2b0b19a9f5ad4557c8dc3b828614e7b1d4250 Mon Sep 17 00:00:00 2001 From: Luigi Date: Fri, 17 Mar 2023 14:40:44 +0100 Subject: [PATCH 44/45] update zip link --- docs/internal-developers/testing/releases/966.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-developers/testing/releases/966.md b/docs/internal-developers/testing/releases/966.md index 58b40226994..a1676ed9869 100644 --- a/docs/internal-developers/testing/releases/966.md +++ b/docs/internal-developers/testing/releases/966.md @@ -1,6 +1,6 @@ # Testing notes and ZIP for release 9.6.6 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10899628/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11001891/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core From 820e48af483995c4bde93911fa2afc4412c4e2b9 Mon Sep 17 00:00:00 2001 From: Luigi Date: Fri, 17 Mar 2023 14:55:00 +0100 Subject: [PATCH 45/45] fix version --- docs/internal-developers/testing/releases/966.md | 4 ++-- package.json | 2 +- readme.txt | 2 +- src/Package.php | 2 +- woocommerce-gutenberg-products-block.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/internal-developers/testing/releases/966.md b/docs/internal-developers/testing/releases/966.md index a1676ed9869..28287b4ff63 100644 --- a/docs/internal-developers/testing/releases/966.md +++ b/docs/internal-developers/testing/releases/966.md @@ -1,11 +1,11 @@ # Testing notes and ZIP for release 9.6.6 -Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11001891/woocommerce-gutenberg-products-block.zip) +Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11003055/woocommerce-gutenberg-products-block.zip) ## WooCommerce Core -### Product Image Gallery: fix 404 error. ([8445](https://github.com/woocommerce/woocommerce-blocks/pull/8445) +### Product Image Gallery: fix 404 error. ([8445](https://github.com/woocommerce/woocommerce-blocks/pull/8445)) 1. Add a new post or page. 2. Check the console and see that any 404 error is visible. diff --git a/package.json b/package.json index 3ce52273f03..977d5b1c24d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@woocommerce/block-library", "title": "WooCommerce Blocks", "author": "Automattic", - "version": "9.6.4", + "version": "9.6.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 60646f2ee20..86b368679cc 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks Requires at least: 6.1.1 Tested up to: 6.1.1 Requires PHP: 7.2 -Stable tag: 9.6.4 +Stable tag: 9.6.5 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/src/Package.php b/src/Package.php index f2bcd1ef80a..0120d8691a8 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 = '9.6.4'; + $version = '9.6.5'; return new NewPackage( $version, dirname( __DIR__ ), diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index 714b3642218..c0dae3766f7 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: 9.6.4 + * Version: 9.6.5 * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woo-gutenberg-products-block