FacetWP filters don’t work with query loop anymore
-
On this page we have 2 query loops that are supposed to be from the same source but being triggered by a True/False button in ACF. Basically we want the top 2 posts to be the highlighted posts and those shouldn’t show up in the main result body with the FacetWP filters. There’s also a little trick I implemented to trigger a invisible Facet to exclude the posts from the results form. And on the top results we use the ACF field for that. But what I noticed before is that the post meta query keys aren’t being saved when you press the update post button on the editor. If you reload the page those fields are empty. It could have something to do with Facet, I’m not sure, but what happens now is whenever you try to filter with Facet’s filters they don’t update the main query anymore. They look like they’re waiting for the filtering to be complete but it never finishes. Can you take a look to see what the problem might be? Also the meta keys not saving might need to be addressed in a bug fix.
Here’s a error my colleague pulled from the logs that might help.
Fatal error: Uncaught TypeError: AdvancedQueryLoop\Query_Params_Generator::__construct(): Argument #2 ($custom_params) must be of type array, null given, called in /www/mrwork_531/public/wp-content/plugins/advanced-query-loop/includes/query-loop.php on line 64 and defined in /www/mrwork_531/public/wp-content/plugins/advanced-query-loop/includes/Query_Params_Generator.php:60 Stack trace: #0 /www/mrwork_531/public/wp-content/plugins/advanced-query-loop/includes/query-loop.php(64): AdvancedQueryLoop\Query_Params_Generator->__construct(Array, NULL) #1 /www/mrwork_531/public/wp-includes/class-wp-hook.php(326): ComposerAutoloaderInit3d22ab91adb43d177572df3b253a90a1::AdvancedQueryLoop\{closure}(Array, Object(WP_Block)) #2 /www/mrwork_531/public/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #3 /www/mrwork_531/public/wp-includes/blocks.php(2046): apply_filters(‘query_loop_bloc…’, Array, Object(WP_Block), 1) #4 /www/mrwork_531/public/wp-includes/blocks/post-template.php(67): build_query_vars_from_query_block(Object(WP_Block), 1) #5 /www/mrwork_531/public/wp-includes/class-wp-block.php(463): render_block_core_post_template(Array, ”, Object(WP_Block)) #6 /www/mrwork_531/public/wp-includes/blocks.php(1705): WP_Block->render() #7 /www/mrwork_531/public/wp-content/plugins/facetwp-blocks/facetwp-blocks.php(581): render_block(Array) #8 /www/mrwork_531/public/wp-includes/class-wp-hook.php(324): FacetWP_Blocks_Integration->query_loop_render_block(‘<ul class=”colu…’, Array, Object(WP_Block)) #9 /www/mrwork_531/public/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘<ul class=”colu…’, Array) #10 /www/mrwork_531/public/wp-includes/class-wp-block.php(525): apply_filters(‘render_block_co…’, ‘<ul class=”colu…’, Array, Object(WP_Block)) #11 /www/mrwork_531/public/wp-includes/class-wp-block.php(443): WP_Block->render() #12 /www/mrwork_531/public/wp-includes/class-wp-block.php(443): WP_Block->render() #13 /www/mrwork_531/public/wp-includes/blocks.php(1705): WP_Block->render() #14 /www/mrwork_531/public/wp-includes/blocks.php(1743): render_block(Array) #15 /www/mrwork_531/public/wp-includes/class-wp-hook.php(324): do_blocks(‘<!– wp:group {…’) #16 /www/mrwork_531/public/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘<!– wp:group {…’, Array) #17 /www/mrwork_531/public/wp-includes/blocks/post-content.php(48): apply_filters(‘the_content’, ‘<!– wp:group {…’) #18 /www/mrwork_531/public/wp-includes/class-wp-block.php(463): render_block_core_post_content(Array, ‘<!– wp:group {…’, Object(WP_Block)) #19 /www/mrwork_531/public/wp-includes/class-wp-block.php(443): WP_Block->render() #20 /www/mrwork_531/public/wp-includes/blocks.php(1705): WP_Block->render() #21 /www/mrwork_531/public/wp-includes/blocks.php(1743): render_block(Array) #22 /www/mrwork_531/public/wp-includes/block-template.php(260): do_blocks(‘<!– wp:templat…’) #23 /www/mrwork_531/public/wp-includes/template-canvas.php(12): get_the_block_template_html() #24 /www/mrwork_531/public/wp-includes/template-loader.php(106): include(‘/www/mrwork_531…’) #25 /www/mrwork_531/public/wp-blog-header.php(19): require_once(‘/www/mrwork_531…’) #26 /www/mrwork_531/public/index.php(17): require(‘/www/mrwork_531…’) #27 {main} thrown in /www/mrwork_531/public/wp-content/plugins/advanced-query-loop/includes/Query_Params_Generator.php on line 60
The page I need help with: [log in to see the link]
- The topic ‘FacetWP filters don’t work with query loop anymore’ is closed to new replies.