Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1150494

    Hello
    we have a domain that use Enfold Version: 4.5.3
    and we have a staging site where is installed Enfold Version: 4.6.2 where I see that you have added support to Relevanssi

    We where using the code suggested in https://kriesi.at/support/topic/limit-ajax-search-results-with-relevanssi/#post-404320 but we have removed it as indicated in latest directive “Since Enfold version 4.5.7.1 Relevanssi ajax search is supported by the theme in the core.”

    We use Relevanssi because it is an eCommerce and we want to limit the search only to the products

    In the staging site the ajax search in top bar is not working. When I enter a text nothing happens and in the console appears an error saying
    jquery.js:4 POST https://staging-profumo.kinsta.cloud/wp-admin/admin-ajax.php 500

    and in the server error log I see this:
    PHP Fatal error: Uncaught TypeError: Argument 2 passed to Avia_Relevanssi::handler_init_ajax_search() must be of the type array, string given
    ——–
    2019/10/23 10:37:32 [error] 60234#60234: *3534 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught TypeError: Argument 2 passed to Avia_Relevanssi::handler_init_ajax_search() must be of the type array, string given, called in /www/profumo_606/public/wp-includes/class-wp-hook.php on line 286 and defined in /www/profumo_606/public/wp-content/themes/enfold/config-relevanssi/class-avia-relevanssi.php:70
    Stack trace:
    #0 /www/profumo_606/public/wp-includes/class-wp-hook.php(286): Avia_Relevanssi->handler_init_ajax_search(‘get_posts’, ‘numberposts=5&p…’, Array, Array)
    #1 /www/profumo_606/public/wp-includes/plugin.php(208): WP_Hook->apply_filters(‘get_posts’, Array)
    #2 /www/profumo_606/public/wp-content/themes/enfold/functions-enfold.php(255): apply_filters(‘avf_ajax_search…’, ‘get_posts’, ‘numberposts=5&p…’, Array, Array)
    #3 /www/profumo_606/public/wp-includes/class-wp-hook.php(286): avia_ajax_search(”)
    #4 /www/profumo_606/public/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
    #5 /www/profumo_606/public/wp-includes/plugin.php(465): W” while reading response header from upstream, client: 2.38.40.237, server: staging-profumo.kinsta.cloud, request: “POST /wp-admin/admin-ajax.php HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php7.3-fpm-profumo.sock:”, host: “staging-profumo.kinsta.cloud”, referrer: “https://staging-profumo.kinsta.cloud/”
    ———————-
    Thank you
    Mauro

    #1150519

    We use Relevanssi just because we want to limit the search only to the products, so if you have a snippet to filter search results will be better for us than using a third-party plugin

    #1150529

    .

    #1151779

    Hi,

    Thank you for the inquiry.

    This issue has been fixed in the latest version of the theme, v4.6.3.1. Please try to upgrade the theme to the most recent version, and toggle the Performance > File Compression settings afterwards. Or edit the related files as instructed in this thread.

    // https://kriesi.at/support/topic/ajax-search-dont-find-keywords-after-relevansi-update/#post-1146993

    It is the same exact solution added in the latest version.

    Best regards,
    Ismael

    #1151835

    Hi,
    I already had version 4.6.3.1 installed but the error 500 is still there even after toggling Performance > File Compression settings and clearing all possible caches
    It works ok anyway now after I changed the file class-avia-relevanssi.php as indicated in https://kriesi.at/support/topic/ajax-search-dont-find-keywords-after-relevansi-update/#post-1146993
    there is a small difference between the two lines:
    public function handler_init_ajax_search( $function_name, array $search_query, array $search_parameters, array $defaults )
    (4.6.3.1 version)
    public function handler_init_ajax_search( $function_name, $search_query, array $search_parameters, array $defaults )
    (version in post https://kriesi.at/support/topic/ajax-search-dont-find-keywords-after-relevansi-update/#post-1146993. This one is OK)

    For other people having the same problem you should make clear, in the other post, that that modification has to be done in the file class-avia-relevanssi.php in folder config-relevanssi
    And please correct in the next update

    Thank you
    Mauro

    #1152049

    Hi,

    Thank you for the update and for the additional info. Yes, you’re right. We forgot to mention the related files for the modification. But rest assured that the fix is already included in the latest version of the theme.

    Please don’t hesitate to open a new thread if you need anything else. Thank you for your patience.

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘PHP Fatal error in class-avia-relevanssi.php’ is closed to new replies.