Skip Navigation

[Resuelto] PHP fatal error with AJAX filtering

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem: AJAX pagination and filtering in archives is causing PHP fatal errors.

Solution: Update to the latest versions of Toolset plugins to get the fix for this issue.

This support ticket is created hace 1 año, 6 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)


We have a View with AJAX filtering of WooCommerce products - see here

hidden link

AJAX filtering times out and the following errors appear in the server logs:

[Thu Jul 15 09:43:05.594991 2021] [proxy_fcgi:error] [pid 14536:tid 140534265796352] [client] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to a member function filtering_via_lookup_table_is_active() on null in /home/\nStack trace:\n#0 /home/ WC_Query->get_tax_query()\n#1 /home/ OTGS\\Toolset\\Views\\Model\\WooCommerce\\WcQuery->product_query()\n#2 /home/ OTGS\\Toolset\\Views\\Model\\WooCommerce\\WcQuery->pre_get_posts()\n#3 /home/ WP_Hook->apply_filters()\n#4 /home/ WP_Hook->do_action()\n#5 /home/53...', referer: hidden link

Everything is up to date. I am wondering if this is related to last night's emergency WooCommerce release that patched a security hole, as this function has been working fine since the site launched.


I meant WooCommerce release, above, not WordPress release!


Just to add, the bug is also preventing pagination from functioning - obviously also tied into AJAX


Hi, I'm able to reproduce a similar error in my local test of a Product Category archive with AJAX filtering based on a custom taxonomy. The error message is identical:

PHP Fatal error:  Uncaught Error: Call to a member function filtering_via_lookup_table_is_active() on nul

Let me try some filter variations and escalate this to my 2nd tier support team for further investigation. I am up-to-date on the latest WooCommerce as well, so it could be related to the recent release. I'll let you know what I find out.


Okay I was able to reproduce similar errors with pagination and with filters based on custom field values as well, so I've escalated this to my 2nd tier support team for further investigation. I'll let you know what they discover and keep you posted here.


We've discovered the issue actually began in the WooCommerce 5.5.0 update, and rolling back to WC 5.4.2 will temporarily resolve the problem. Our developers are working on a fix and I'll let you know as soon as it's available.


Thanks for the update. In light of the recent security issue on Woo - hidden link - we obviously won't be in a position to roll back WooCommerce, as every version from 3.3 contains the vulnerability. So we will stand by for a fix.



Our developers have informed me that the permanent fix for this problem will be included in the upcoming Views and Blocks releases, which we tentatively plan to release later this week or early next week. In the meantime, considering this is a significant problem potentially impacting many clients, we have created a patch to solve the problem now, with the latest version of WooCommerce active. Please find the patch file available for download at the following link:

To install the patch, download and unzip the package, then upload the WcQuery.php file it contains to replace the file with the same name in the following Toolset Blocks plugin path:


For others who find this ticket:
If you are using the legacy Toolset Views plugin instead of the Toolset Blocks plugin, the patch file is identical for either plugin. You will upload the patch file to the corresponding Toolset Views plugin path:


AJAX filters and pagination should be working as expected now after applying the patch. Please let me know if the problem is not completely resolved.


Great - I can confirm the patch worked on the afflicted site!


Patch worked for me, too. Thank you!


The permanent fix for this issue has been included in the latest round of plugin updates. After updating, the patch is no longer required.