• Resolved jnz31

    (@jnz31)


    i have a custom page template, where i show all sales items.
    it threw following error:
    Fatal error: Uncaught Error: Call to a member function is_search() on bool in ./wp-includes/query.php:703 Stack trace: #0 ./wp-content/plugins/facebook-for-woocommerce/facebook-commerce-events-tracker.php(378): is_search() #1 ./wp-includes/class-wp-hook.php(303): WC_Facebookcommerce_EventsTracker->inject_search_event(Object(WP_Query)) #2 ./wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #3 ./wp-includes/plugin.php(518): WP_Hook->do_action(Array) #4 ./wp-includes/class-wp-query.php(1784): do_action_ref_array('pre_get_posts', Array) #5 ./wp-includes/class-wp-qu in ./wp-includes/query.php on line 703

    inside facebook-commerce-events-tracker.php i changed
    public function inject_search_event() {
    to
    public function inject_search_event($query) {

    and
    if ( ! $this->is_pixel_enabled() ) {
    to
    if ( ! $this->is_pixel_enabled() || ! $query->is_main_query() ) {

    to solve the issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support lionel.a11n

    (@lioneldaniel)

    Hello @jnz31,

    Thanks for sharing your streamlined fix for your issue! I’ve shared your comment back on the issue you opened about this problem on the official GitHub repository.

    As this is a reported bug, I’ll mark this as resolved – hopefully your work on the issue will make it quicker for the development team to address this in the core plugin.

    Your time makes the plugin better for everybody, thanks for contributing!

    Thread Starter jnz31

    (@jnz31)

    LOL. i didn’t even realize i fixed this bug before 😅 with explanation and all. it probably reoccurred since i installed some updates.

    Plugin Support Sol J. a11n

    (@solstudioim)

    Hey @jnz31

    i didn’t even realize i fixed this bug before 😅 with explanation and all. it probably reoccurred since i installed some updates.

    Ah I see, as we mentioned before, we have added your report to the above Github issue.

    At this point, my hands are pretty much tied here, but fingers crossed, the issue will be resolved soon 🙂

    Have a wonderful day ahead!

    • This reply was modified 2 years, 9 months ago by Sol J. a11n.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal error: Uncaught Error: Call to a member function is_search() on bool’ is closed to new replies.