This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Add to cart form: Fix fatal error when missing product
param in add_to_cart_redirect_filter
#10316
Merged
thealexandrelara
merged 4 commits into
trunk
from
fix/fatal-error-when-not-all-params-are-sent-to-add-to-cart-redirect-filter
Jul 24, 2023
Merged
Add to cart form: Fix fatal error when missing product
param in add_to_cart_redirect_filter
#10316
thealexandrelara
merged 4 commits into
trunk
from
fix/fatal-error-when-not-all-params-are-sent-to-add-to-cart-redirect-filter
Jul 24, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The release ZIP for this PR is accessible via:
Script Dependencies ReportThe
This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: 0 B Total Size: 1.36 MB ℹ️ View Unchanged
|
thealexandrelara
added
type: bug
The issue/PR concerns a confirmed bug.
priority: critical
The issue is critical—e.g. a fatal error, security problem affecting many customers.
block: add to cart form
and removed
priority: critical
The issue is critical—e.g. a fatal error, security problem affecting many customers.
labels
Jul 22, 2023
woocommercebot
requested review from
a team and
albarin
and removed request for
a team
July 22, 2023 13:23
albarin
approved these changes
Jul 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
thealexandrelara
deleted the
fix/fatal-error-when-not-all-params-are-sent-to-add-to-cart-redirect-filter
branch
July 24, 2023 14:45
alexflorisca
pushed a commit
that referenced
this pull request
Jul 25, 2023
…_to_cart_redirect_filter (#10316) * Transform product param optional in add_to_cart_redirect_filter method * Remove unnecessary argument from add_to_cart_redirect_filter * Remove mocked filter call * Remove unnecessary argument from function docs
alexflorisca
pushed a commit
that referenced
this pull request
Jul 25, 2023
…_to_cart_redirect_filter (#10316) * Transform product param optional in add_to_cart_redirect_filter method * Remove unnecessary argument from add_to_cart_redirect_filter * Remove mocked filter call * Remove unnecessary argument from function docs
alexflorisca
added a commit
that referenced
this pull request
Jul 26, 2023
* Add to cart form: Fix fatal error when missing `product` param in add_to_cart_redirect_filter (#10316) * Transform product param optional in add_to_cart_redirect_filter method * Remove unnecessary argument from add_to_cart_redirect_filter * Remove mocked filter call * Remove unnecessary argument from function docs * Empty commit for release pull request * Change versions * update package-lock --------- Co-authored-by: Alexandre Lara <allexandrelara@gmail.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
gigitux
pushed a commit
that referenced
this pull request
Jul 31, 2023
…_to_cart_redirect_filter (#10316) * Transform product param optional in add_to_cart_redirect_filter method * Remove unnecessary argument from add_to_cart_redirect_filter * Remove mocked filter call * Remove unnecessary argument from function docs
gigitux
added a commit
that referenced
this pull request
Jul 31, 2023
* Fix: WooCommerce Blocks causing malfunction of the navigation block on WordPress 6.3 (#10388) * Make sure the revert button is registered and enqueued for usage exclusively in the site editor. * Register and enqueue the styles for the revert button. * Rename the files. * Revert "Rename the file renames." This reverts commit c0330ce. * Add plugin-proposal-optional-chaining to the WebPack plugins config. * Rename the files. * Remove unnecessary dependencies as those are already provided via : more specifically, get_script_data. * Address CR. * Cart and Checkout Page Migration: Inherit Page template and fix rendering (#10375) * Change shortcode block render callback * Inherit template from original "page" template * Check if WordPress version is higher than 6.2.2 to make Products block compatible with Gutenberg 16+ (#10360) * Check if WordPress version is higher than 6.2.2 to make Products block compatible with Gutenberg 16+ * Extract the logic of checking the post template support for grid view toi separate function * Change the versions comparison and improve description of custom version compare function * Render Checkout/Cart containing pages without template overriding (#10359) * Render Checkout/Cart containing pages without template overriding * Fix checkout typo --------- Co-authored-by: Mike Jolley <mike.jolley@me.com> * Add to cart form: Fix fatal error when missing `product` param in add_to_cart_redirect_filter (#10316) * Transform product param optional in add_to_cart_redirect_filter method * Remove unnecessary argument from add_to_cart_redirect_filter * Remove mocked filter call * Remove unnecessary argument from function docs * Remove opinionated styles from Product Hero pattern (#10255) * Mini Cart: Remove deprecated print_inline_script() (#10165) * Mini Cart: Replace the deprecated print_inline_script() with supported get_inline_script_data(). Fixes #10004 * Mini Cart: Add version check for the new get_inline_script_data() function * Update the variable names and fix a typo * Mini Cart: Add regex to check for the WP version * Abstract the WP version comparison regex to a separate Utils class * Call wc_setup_product_data if the global product variable is not an instance of WC_Product. (#10128) * Empty commit for release pull request * add testing instructions * Per block stylesheets (#9831) * Clean up blank lines * Update Webpack config * Update PHP logic to load block styles * Style fixes * Style fixes (II) * Style fixes (III) * Style fixes (IV) * Fix missing stylesheets in the Site Editor * Fix wrong return values in some PHP method docs * Fix missing ProductPrice stylesheet causing 404 in tests * Fix missing ProductGallery stylesheet causing 404 in tests * update testing instructions * add zip link * update version * update zip link * remove screenshot * remove testing instructions * Register Legacy block for all taxonomy-product_ template (#10382) * WIP * improve logic * improve unit test * $post validation on Cart and Checkout template (#10410) Co-authored-by: Luigi Teschio <gigitux@gmail.com> * Update zip --------- Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com> Co-authored-by: Mike Jolley <mike.jolley@me.com> Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com> Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> Co-authored-by: Alexandre Lara <allexandrelara@gmail.com> Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Luigi <gigitux@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a fatal error that was occurring when some plugins were applying the
woocommerce_add_to_cart_redirect
filter without including all arguments. (ref: p1689956599964279-slack-C7YPW6K40)Walkthrough
🤖 Generated by Copilot at 7451d9a
woocommerce_add_to_cart_redirect
filter hook to accept only$url
parameter and remove unused$product
parameter fromadd_to_cart_redirect_filter
method (link, link) insrc/BlockTypes/AddToCartForm.php
User Facing Testing
src/BlockTypes/AddToCartForm.php
. Modify theadd_to_cart_message_html_filter
function and include the following piece of code (the reason for this is because we want to simulate what is causing the fatal error). Make sure to modify thehttp://yoursite.local/cart/
with the url of your local site, for example:http://woodev.local/cart/
:The expected code should be like this:
WooCommerce Visibility
Performance Impact
Changelog