Skip Navigation

[Resolved] A view using AJAX to filter results returns incorrect information

This thread is resolved. Here is a description of the problem and solution.

Problem:

I am having an issue with AJAX results updating when visitors change filter values on my site. After configuring the view, the initial page load looks good, but using filters renders results incorrectly, displaying unparsed shortcodes.

Solution:

WPBakery does not register shortcodes on AJAX requests, causing unparsed shortcodes on content updates. A suggested solution is provided in a forum thread: https://toolset.com/forums/topic/wpbakery-shortcodes-appearing-when-using-ajax-filtering-for-results/#post-1292959. If the workaround fails, consider reaching out to WPBakery support or disabling AJAX updates for WPBakery-designed content.

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.

This topic contains 3 replies, has 3 voices.

Last updated by Christopher Amirian 1 year, 4 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2679735
2673645-Error.png
2673645-Initial_Page_Load.png

Hi

I've configured a view to list some posts in this page in my site: hidden link

When I configured the view, I used the "AJAX results update when visitors change any filter values" option in the "Custom Search Settings".

When I first load the page, everything looks good (Initial Page Load.png) but then, if I use any of the filters (either the search box or one of the dropdowns) then the results are rendered in an incorrect way (Error.png)

The exact same configuration that I have right now used to work fine in my previous version of the site, which used PHP 7.0.30 and Toolset version 2.6.3. Now I'm using PHP 8.2.12 and Toolset version 3.6.11

If I use "Full page refresh when visitors click on the search button with input values auto-updating" in "Custom Search Settings", I get the content in the correct way when I use the filters. However, this forces me to reload the page, which is the undesired behaviour.

Could you please advise?

Thanks

#2679799

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

The problem here is that WPBakery does not register its shortcodes on ajax requests, hence you see the unparsed shortcodes when the contents are updated via ajax.

See this thread for a solution you can try, though note that some clients have at times reported the workaround stopped working. If that's the case you could try contacting WPBakery support and asking if there is an alternative way of registering their shortcodes, otherwise you would need to disable ajax updates for content designed with WPBakery.

https://toolset.com/forums/topic/wpbakery-shortcodes-appearing-when-using-ajax-filtering-for-results/#post-1292959

#2680207
Shortcode mapper.jpg

Hi Nigel

I tried the proposed solution but it didn't work.

I looked in the WPBakery Page Builder menu and I found there's a Shortcode Mapper option. Could this be what we need? If yes, do you know what values I should use in the textbox?

#2680228

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

I do not think that is related, as the shortcode mapper is for other custom shortcodes to make it compatible with WPBakery but not unparse the shortcodes as mentioned by my colleague.

The best way is to ask the WP Bakery support.

Thanks.