β 𧩠π Compatibility issue with FacetWP caused by Optimize Image Loading feature #24226
Closed
5 tasks done
Labels
bug
Indicates a bug with one or multiple components.
compatibility/3rd-party
Indicates a compatibility problem with a 3rd-party plugin or theme.
mod/c*
product/pro
Indicates if the referenced component is part of the Elementor Pro plugin.
solved
Indicates that an Issue has been Solved, or a Feature Request has been Released.
status/merged
Indicates when a Pull Request has been merged to a Release.
theme-builder/archive-template
References any Archive template feature of Elementor Proβs Theme Builder.
theme-builder
References any component related to Elementor Proβs Theme Builder.
type/experiment
Indicates when a topic is related to a Stable or Unstable Feature or Experiment.
type/performance
Indicates when a topic is related to Performance.
widget/posts*
References the (legacy) Posts (Pro) widget.
Milestone
Prerequisites
Description
Activating the Optimize Image Loading feature when using FacetWP causes errors when Facet filters are used on a page where Elementor widgets for the post loop that is being filtered with Facet. The error only occurs during Facet's ajax post that should return JSON formatted text rather than an HTML page - https://d.pr/i/LqReTd
We have found it occurs because Elementor's Optimize Image Loading opens a buffer on get_footer that is only flushed on end of script - https://d.pr/i/gS1exg - leaving Facet unable to correctly close its own buffer that is used to capture the part of the page html returned in its JSON text. Facet uses ob_get_clean on the shutdown WP hook.
In testing all setups of elementor widgets for the post query and loop that can be used with Optimize Image Loading inactive, have the error when Optimize Image Loading is active.
It does not occur if using a FacetWP listing template for the posts.
Steps to reproduce
The error can occur without FacetWP Elementor addon. You can setup the posts archive template as above but will not be able to Enable facet in the post widget settings and will have to add the category facet as a shortcode. This setup should work with facet's auto detection of the archive query. It will not work on a non-archive page or if the query source is not current query.
I can provide access to FacetWP and the addon to your developers by whatever non-public method you prefer.
Isolating the problem
System Info
Click to reveal
The text was updated successfully, but these errors were encountered: