• Resolved espressivo

    (@espressivo)


    I’m seeing a recurring PHP 8 fatal in Better_Search_Core_Query::posts_pre_query() on a client site, triggered whenever another plugin runs a WP_Query with fields => 'ids'. In this case it’s FacetWP’s renderer, but I’d expect it to fire for any plugin or theme that does the same. Confirmed on the current version of Better Search. Deactivating Better Search resolves the fatals, so the plugin is definitively the source.

    PHP Fatal error: Uncaught Error: Attempt to assign property “score” on int in
    /wp-content/plugins/better-search/includes/class-better-search-core-query.php:1233

    0 Better_Search_Core_Query->posts_pre_query() 1 WP_Hook->apply_filters() 2 apply_filters_ref_array() [class-wp-query.php:3226] 3 WP_Query->get_posts() [class-wp-query.php:3958] 4 WP_Query->query() [class-wp-query.php:4090] 5 WP_Query->__construct() [facetwp/includes/class-renderer.php:400] 6 FacetWP_Renderer->get_filtered_post_ids() [class-renderer.php:146] 7 FacetWP_Renderer->render() [class-request.php:185] 8 FacetWP_Request->update_query_vars()

    … 13 WP->query_posts() → WP->main() → wp() → index.php

    FacetWP calls WP_Query with fields => 'ids' (see class-renderer.php:400), so posts_pre_query receives an array of integer post IDs rather than WP_Post objects. Line 1233 then does something like $post->score = …, which is a fatal on PHP 8+ (silent warning on PHP 7).

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ajay

    (@ajay)

    @espressivo

    I think I need a check for this, as for some reason, FacetWP is overriding queries more globally.

    I don’t use this but can you tell me how you set it up so I can see if I can replicate this?

    Thread Starter espressivo

    (@espressivo)

    I have Facetwp activated with filters on the page. Nothing particularly special. Do you have a support email I can forward more information to?

    Plugin Author Ajay

    (@ajay)

    @espressivo

    Sorry for the delayed response. Please could you contact me via WebberZone.com/request-support/

    I have opened that up for all users.

    Also, I updated Better Search to v4.3 so please do check if you still have that issue.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.