-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error is_search()
with custom page / query
#1936
Comments
Do you want to say that it started to work again? |
well, yes. if i remove all functionality from the function generates the error. it is gone now, since i removed all its contents.. guess it will break something else, but at least my template is now working properly.. |
Hi there @jnz31 - thanks for reaching out. It sounds like you have some customizations that might be a factor here - we haven't had any reports from other users of this fatal error. Can you try to reproduce this issue on a clean site running current versions of WordPress, WooCommerce and Facebook for WooCommerce, and a standard theme such as Storefront or Twenty Twenty? If you can reproduce the fatal error without any custom PHP templates, add the details here so we can figure out what's happening. On the other hand, if this issue is caused by an interaction with your custom template code and a recent update to Facebook for WooCommerce, you'll need to debug your template & query. |
ciao @haszari i boiled it down a little further: you inject
here is the fix:
aka: passing |
here is another solution, also involving the use of the
|
Aha, thanks for digging @jnz31 ! |
is_search()
with custom page / query
@jnz31 also shared this error in a post on the .org support forum with a streamlined description of the fix which may be useful here as well:
|
yo? can someone implement this easy fix plz?! |
✍️ Describe the bug
Fatal error: Uncaught Error: Call to a member function is_search() on bool in /xxx/wp-includes/query.php:703 Stack trace: #0 /xxx/wp-content/plugins/facebook-for-woocommerce/facebook-commerce-events-tracker.php(378): is_search() #1 /xxx/wp-includes/class-wp-hook.php(292): WC_Facebookcommerce_EventsTracker->inject_search_event(Object(WP_Query)) #2 /xxx/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array) #3 /xxx/wp-includes/plugin.php(551): WP_Hook->do_action(Array) #4 /xxx/wp-includes/class-wp-query.php(1784): do_action_ref_array('pre_get_posts', Array) #5 /xxx/wp-includes/class-wp-qu in /xxx/wp-includes/query.php on line 703
🚶♀️ Steps to reproduce
i have a custom page for sale items, where i take the "normal"
$wc_query
and add taxonomy (f.ex. sale/women) and'post__in' => wc_get_product_ids_on_sale()
. it is based on woocommerce'sarchive-product.php
.here is my tax_query
meta_query (only show in-stock items)
...custom query:
✔️ Expected behavior
this is new behavior (client pointed me to the failing sale page on friday), it worked with no issues before (> 6 month), so not sure, what causes this issue.
i now uncommented the contents of
inject_search_event()
and it works for me.i attached my template file, the is a function called
jnz_output_category_navigation()
. it is not related to this issue.page-sale.php.zip
The text was updated successfully, but these errors were encountered: