[Resolved] Ajax search for VIEWS breaks the website
This support ticket is created 2 years, 3 months ago. 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I am trying to:
Hello, I have found a common Toolset compatibility bug with PHP 8.0 so I had to downgrade the PHP version to 7.4. I have created a view a there is a search field that performs the AJAX search. It used to work fine previously I recently migrated my hosting to Linode and we had PHP 8.0 here so I downgraded it. However, it doesn't solve the problem. When ajax search is enabled, it breaks the code and throws a critical error.
Link to a page where the issue can be seen: hidden link
I expected to see:
A working search option with AJAX enabled however it is not working correctly so I had to disable the ajax for now in order to make the page work.
Instead, I got:
Screenshot attached.
Thank you for getting in touch. I managed to take a look at your site and noticed that once the AJAX is enabled the following notice is being displayed in the debug log.
[13-Jan-2022 19:30:14 UTC] PHP Deprecated: Required parameter $field follows optional parameter $post in /var/www/html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/api.php on line 405
[13-Jan-2022 19:30:14 UTC] The is_ajax function is deprecated since version 6.1.0. Replace with wp_doing_ajax.
It's quite possible that since you have 50 plus active plugins that there is some conflict between your plugins/theme.
In a case like this when the plugins are not functioning as intended we recommended that you disable the non-toolset plugins.
What this means is that you will need to go through your list of plugins and disable each of your plugins one at a time while checking to see if the issue still remains.
Hello Shane.
Thank you for getting back to me. Well, I was having the exact same number of plugins before as well on the previous server so I don't think this is the reason. This bug is reported commonly by many Toolset users on their forum as well e.g: https://toolset.com/forums/topic/php-8-fatal-error/
My scenario was exactly the same. My new server hosted on Linode CENT OS had PHP 8.0 installed so it replicated the same errors. However, when I downgraded the PHP version, fixed some part of it but not all.
The issue still exists when I switch to "Ajax search" or "Let me chose settings manually" option.
I took a copy of your site and ran it locally here. With no change the AJAX worked perfectly fine. I see from your debug data that php version 8 is enabled again.
I know that we have not yet announced php 8 compatibility as yet but we are working on compatibility. I would like if you downgraded back to at least version 7.4 of PHP so that I can continue to troubleshoot.
Thanks,
Shane
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.