Open WillBrubaker opened 5 years ago
@juliaamosova Is this going to get assigned to a future milestone?
As this issue is already quite dated, we'll try to reproduce this on the current released version of WooCommerce to see if this issue is still happening. I'm adding the status: needs reproduction
label for the meantime.
Hi @WillBrubaker ,
Thank you for taking the time to report this bug, we really appreciate your help. We are able to reproduce the issue on our end using WooCommerce 6.0.0 version , WordPress 5.8.2 version and nginx server .
Please find below screenshots for reference :
Priority of this issue will be assigned shortly after we’d go through a round of prioritization. Please note it may take a couple of days.
Hi @WillBrubaker I tried to replicate this again, it didn't spawn the fatal, but instead produced a warning on another place related to the session object (log below). It does seem that not considering the oembed as a frontend request still produces nefarious side effects, I'm adding this to our backlog. As a quick note, I do not think we should be safeguarding against invalid data, but look into what evaluates the request as considered frontend and how oembed relates to that.
[02-May-2024 21:29:58 UTC] PHP Warning: Attempt to read property "order_awaiting_payment" on null in /var/www/html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 187
[02-May-2024 21:29:58 UTC] PHP Stack trace:
[02-May-2024 21:29:58 UTC] PHP 1. {main}() /var/www/html/index.php:0
[02-May-2024 21:29:58 UTC] PHP 2. require() /var/www/html/index.php:17
[02-May-2024 21:29:58 UTC] PHP 3. require_once() /var/www/html/wp-blog-header.php:19
[02-May-2024 21:29:58 UTC] PHP 4. do_action($hook_name = 'template_redirect') /var/www/html/wp-includes/template-loader.php:13
[02-May-2024 21:29:58 UTC] PHP 5. WP_Hook->do_action($args = [0 => '']) /var/www/html/wp-includes/plugin.php:517
[02-May-2024 21:29:58 UTC] PHP 6. WP_Hook->apply_filters($value = '', $args = [0 => '']) /var/www/html/wp-includes/class-wp-hook.php:348
[02-May-2024 21:29:58 UTC] PHP 7. wc_clear_cart_after_payment('') /var/www/html/wp-includes/class-wp-hook.php:324
Describe the bug WordPress adds discovery links. If those discovery links are somehow malformed this will result in a fatal error when visiting that link if the theme in use loads a mini-cart.
To Reproduce
Fatal error: Uncaught Error: Call to a member function get_cart_subtotal() on null
Expected behavior No fatals and I'd just like to point out that I notice a difference if we do the same type of steps on a site hosted on an Apache server e.g.: https://wctesting.club/blog/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwctesting.club%2Fsample-page%2F&format=xml
results in:
Isolating the problem (mark completed items with an [x]):
WordPress Environment