diff --git a/assets/js/frontend/checkout.js b/assets/js/frontend/checkout.js index e1ddad1f764..104db51918f 100644 --- a/assets/js/frontend/checkout.js +++ b/assets/js/frontend/checkout.js @@ -563,7 +563,7 @@ jQuery( function( $ ) { wc_checkout_form.$checkout_form.removeClass( 'processing' ).unblock(); wc_checkout_form.$checkout_form.find( '.input-text, select, input:checkbox' ).trigger( 'validate' ).blur(); wc_checkout_form.scroll_to_notices(); - $( document.body ).trigger( 'checkout_error' ); + $( document.body ).trigger( 'checkout_error' , [ error_message ] ); }, scroll_to_notices: function() { var scrollElement = $( '.woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout' ); diff --git a/changelog.txt b/changelog.txt index 0cf4250674e..7aae231c2be 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,64 @@ == Changelog == += 4.7.0 - 2020-11-10 = + +**WooCommerce** + +* Tweak - Update `product_cat/tag` taxonomy template file names to `product-cat/tag`. #27736 +* Tweak - Exclude draft pages from the "Shop page" setting. #27890 +* Tweak - Styling to properly display product reviews within the dashboard activity widget. #27968 +* Fix - Fixes Photoswipe action buttons being obscured by admin bar. #27010 +* Fix - Allow variation image to be removed via REST API. #27299 +* Fix - Fixed WP CLI command to delete tax classes. #27310 +* Fix - Prevent regenerate image filter loop. #27483 +* Fix - Fixed some race conditions in `WC_Install`. #27696 +* Fix - Improved PHP 8 support for `Automattic\WooCommerce\RestApi\Utilities\SingletonTrait`. #27707 +* Fix - Adjust stock even if `reduce_stock` meta is not set in `wc_maybe_reduce_stock_levels`. #27763 +* Fix - Removed duplicated CSS code from jQuery UI. #27767 +* Fix - HTML syntax error in scheduled product message. #27842 +* Fix - Update logic to determine if an order requires payment to check the order instead of the cart. #27893 +* Fix - Use `Set password` title for lost password reset form when applicable. #27898 +* Fix - REST API - Fixed deprecated notices while querying orders and refunds through REST API v1 endpoints. #27934 +* Fix - Email address starting with `www` being displayed as a URL link in the admin order details page. #27983 +* Fix - Unexpected HTTP 401 "Sorry, you cannot list resources" REST API responses that occur when a plugin or custom code determines the current WordPress user before WooCommerce is fully initialized. #27587 +* Dev - Add `woocommerce_should_send_low_stock_notification` filter. #27819 +* Dev - Introduce (again) a dependency injection framework for the code in the src directory. #27733 +* Dev - Remove leftover code and data from the reverted improvement for variations filtering by attribute. #27748 +* Dev - Escaped labels in `woocommerce_form_field()`. #27800 +* Dev - Add a `NumberUtil::round` method to workaround a breaking change in the buil-in round function in PHP8. #27830 +* Dev - Remove default value from optional parameters that are followed by required parameters in functions/methods, since those are de-facto required and trigger a deprectation notice in PHP 8. #27840 +* Dev - REST API - Add user-friendly attribute names and values to order line items metadata. +* Dev - REST API - Adds `parent_name` to `line_items` of the GET /orders endpoint. +* Localization - Added Serbia districts. #27778 +* Localization - Make city, and postcode non-required fields. #27779 +* Localization - Add i18n locale information for Uganda, Kenya and Tanzania. #27164 +* Localization - Renamed "Postcode / ZIP" to "Pin code", and renamed "State / County" to "State" for India. #27516 +* Localization - Added postcode validation for addresses in India. #27546 + +**WooCommerce Blocks - 3.5.0 & 3.6.0** + +* Make 'retry' property on errors from checkoutAfterProcessingWithSuccess/Error observers default to true if it's undefined. ([3261](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3261)) +* Ensure new payment methods are only displayed when no saved payment method is selected. ([3247](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3247)) +* Load WC Blocks CSS after editor CSS. ([3219](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3219)) +* Restore saved payment method data after closing an express payment method. ([3210](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3210)) +* Use light default background colour for country/state dropdowns. ([3189](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3189)) +* Fix broken Express Payment Method use in the Checkout block for logged out or incognito users. ([3165](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3165)) +* Fix State label for Spain. ([3147](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3147)) +* Don't throw an error when registering a payment method fails. ([3134](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3134)) +* Don't load contents of payment method hidden tabs. ([3227](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3227)) +* Use noticeContexts from useEmitResponse instead of hardcoded values. ([3161](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3161)) + +**WooCommerce Admin - 1.6.3** + +* Tweak: Add BR and IN to list of stripe countries [#5377](https://github.com/woocommerce/woocommerce-admin/pull/5377) +* Fix: Redirect instead of stalling on WCPay Inbox note action [#5413](https://github.com/woocommerce/woocommerce-admin/pull/5413) + += 4.6.2 - 2020-11-05 = + +**WooCommerce** + +* Prevent checkout from creating accounts when related setting is disabled. + = 4.6.1 - 2020-10-21 = **WooCommerce** diff --git a/composer.lock b/composer.lock index 5e55ec3f1f6..2890d0ccd20 100644 --- a/composer.lock +++ b/composer.lock @@ -259,6 +259,12 @@ "provider", "service" ], + "funding": [ + { + "url": "https://github.com/philipobenito", + "type": "github" + } + ], "time": "2020-09-28T13:38:44+00:00" }, { @@ -446,27 +452,22 @@ }, { "name": "symfony/css-selector", - "version": "v3.4.45", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "9ccf6e78077a3fc1596e6c7b5958008965a11518" + "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/9ccf6e78077a3fc1596e6c7b5958008965a11518", - "reference": "9ccf6e78077a3fc1596e6c7b5958008965a11518", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/da3d9da2ce0026771f5fe64cb332158f1bd2bc33", + "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\CssSelector\\": "" @@ -495,7 +496,21 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2020-03-16T08:31:04+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T10:57:07+00:00" }, { "name": "woocommerce/action-scheduler", @@ -686,5 +701,6 @@ "platform-dev": [], "platform-overrides": { "php": "7.1" - } + }, + "plugin-api-version": "1.1.0" } diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index 9a90cbef4c0..671961040ac 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -667,15 +667,18 @@ class WC_Checkout { * @return array of data. */ public function get_posted_data() { - $skipped = array(); - $data = array( - 'terms' => (int) isset( $_POST['terms'] ), // WPCS: input var ok, CSRF ok. - 'createaccount' => (int) ! empty( $_POST['createaccount'] ), // WPCS: input var ok, CSRF ok. - 'payment_method' => isset( $_POST['payment_method'] ) ? wc_clean( wp_unslash( $_POST['payment_method'] ) ) : '', // WPCS: input var ok, CSRF ok. - 'shipping_method' => isset( $_POST['shipping_method'] ) ? wc_clean( wp_unslash( $_POST['shipping_method'] ) ) : '', // WPCS: input var ok, CSRF ok. - 'ship_to_different_address' => ! empty( $_POST['ship_to_different_address'] ) && ! wc_ship_to_billing_address_only(), // WPCS: input var ok, CSRF ok. - 'woocommerce_checkout_update_totals' => isset( $_POST['woocommerce_checkout_update_totals'] ), // WPCS: input var ok, CSRF ok. + // phpcs:disable WordPress.Security.NonceVerification.Missing + $data = array( + 'terms' => (int) isset( $_POST['terms'] ), + 'createaccount' => (int) ( $this->is_registration_enabled() ? ! empty( $_POST['createaccount'] ) : false ), + 'payment_method' => isset( $_POST['payment_method'] ) ? wc_clean( wp_unslash( $_POST['payment_method'] ) ) : '', + 'shipping_method' => isset( $_POST['shipping_method'] ) ? wc_clean( wp_unslash( $_POST['shipping_method'] ) ) : '', + 'ship_to_different_address' => ! empty( $_POST['ship_to_different_address'] ) && ! wc_ship_to_billing_address_only(), + 'woocommerce_checkout_update_totals' => isset( $_POST['woocommerce_checkout_update_totals'] ), ); + // phpcs:enable WordPress.Security.NonceVerification.Missing + + $skipped = array(); foreach ( $this->get_checkout_fields() as $fieldset_key => $fieldset ) { if ( $this->maybe_skip_fieldset( $fieldset_key, $data ) ) { $skipped[] = $fieldset_key; diff --git a/includes/class-wc-shortcodes.php b/includes/class-wc-shortcodes.php index 705b57d3e92..1fdebe7ca35 100644 --- a/includes/class-wc-shortcodes.php +++ b/includes/class-wc-shortcodes.php @@ -565,7 +565,7 @@ class WC_Shortcodes { $single_product = new WP_Query( $args ); ?>