Elasticpress: Issues with FacetWP

Created on 19 May 2017  路  6Comments  路  Source: 10up/ElasticPress

When FacetWP is activated im getting a fatal error on some pages.

PHP Catchable fatal error: Object of class WP_Post could not be converted to string in /dom10096/wp-content/plugins/facetwp/includes/class-facet.php on line 207

When i disabled ElasticPress is all back in action. Looks like FacetWP expects array of ids on that line and elasticpress somehow sends WP_POST

question

Most helpful comment

@misulicus looks like facetwp using return field parameter (https://codex.wordpress.org/Class_Reference/WP_Query#Return_Fields_Parameter) which is not currently supported by Elasticpress, but we are working on it.
You can try it in this PR #760

All 6 comments

@misulicus,
the way ElasticPress work is extending wp_query to use Elasticsearch to get the result, and won't change the output type. So basically it will work with other plugin.
And facetwp is a paid plugin and come with premium support, so I would suggest to open ticket to them and let them see why it cause the error.

@ivankristianto sorry for the delay.
I tested by doing a var_dump of the data on the line with the error and when elasticpress is not active the result is an array of post Ids (like facewp needs) but when elastic press is enabled the result is an array of post objects so its definetly altering the output

@misulicus looks like facetwp using return field parameter (https://codex.wordpress.org/Class_Reference/WP_Query#Return_Fields_Parameter) which is not currently supported by Elasticpress, but we are working on it.
You can try it in this PR #760

@ivankristianto so good news is with that PR my page works with FacetWP and ES but the hosting guys said this:

However, couple of feature scripts from ElasticPress had to be moved away from site folder. They were also deleted in pull request. Moved files are:
/data/s150184/dom10096/dom10096/wp-content/plugins/elasticpress/features/search/search.php
/data/s150184/dom10096/dom10096/wp-content/plugins/elasticpress/features/woocommerce/woocommerce.php

Is that something that is a change in ES cause of that PR ? cause i can't seem to find and reference to those files being removed. And with them removed any idea what "changes"

@misulicus Those 2 files are important files. I suggest to copy the files back.

All good now. And yep that PR fixes the issue with FacetWP

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kallehauge picture kallehauge  路  9Comments

keg picture keg  路  4Comments

roditi3811 picture roditi3811  路  4Comments

andrewbanchich picture andrewbanchich  路  3Comments

MediaMaquina picture MediaMaquina  路  3Comments