Closed RexHavoc69 closed 2 months ago
In the image you can see our Display on Search Results option.
Add an extra option in here:
"Show but delay execution"
Make it so that this option is disabled if the widget does not have a Display Container set, otherwise it won't make sense.
Currently - if there is a display container, we still need to run the underlying code to check if we should even display the container. In this new code, if the widget says Show but delay execution, then we would always display the container on the search results with the related ajax class (you can find the ajax class inside the tax widget).
i.e. this should be quite simple - when displaying a container like this, we can avoid running the fast cats queries and the walktree function until a user clicks the container.
Summary: with this option, the container should always be displayed and the first page load the actual SQL and walktree function will not run on initial page load, instead they will run through the ajax call using the existing ajax callback code. It should be a simple matter of avoiding the fastcatsql, the walktree, but making sure the right ajax classes are on the container to enable the other code.
I've ended up reverted this code out of the master branch as it's quite broken and a bit of a mess.
I'll code up the solution myself so it re-uses my existing ajax code.
Fixed in 5.87