Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #1143621

    Hi there,

    the search preview is no longer working after the update.

    Failed to load resource: the server responded with a status of 500 () – /wp-admin/admin-ajax.php

    I already downloaded the theme again and uploaded it but no change. I saw plenty of other users having this problem but no fix yet. Please let me know how to get it working again.

    Best,
    El

    #1144603

    Hi there,

    Please help as search is still not working since the latest update.

    Best,
    El

    #1145496

    Hi,

    This does not seem related to our theme, rather than something on your theme. 500 error seems to have blocked the request for a reason.

    Best regards,
    Basilis

    #1145617

    Hi Basilis,

    you guys keep saying this in various threads where customers suddenly have a problem with the Relevanssi search after the update.

    Please check this throughly because a lot of customers on this forum now have this issue.

    Best,
    El

    #1145618
    #1145757

    Here is the bug in enfold that causes this:

    Hi guys, here is the bug in the relevanssi adaption in enfold. This used to work flawlessly:

    [07-Oct-2019 11:46:05 UTC] 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 /web/wp-includes/class-wp-hook.php on line 286 and defined in /web/wp-content/themes/enfold/config-relevanssi/class-avia-relevanssi.php:70
    Stack trace:
    #0 /web/wp-includes/class-wp-hook.php(286): Avia_Relevanssi->handler_init_ajax_search(‘avia_relevanssi…’, ‘numberposts=5&p…’, Array, Array)
    #1 /web/wp-includes/plugin.php(208): WP_Hook->apply_filters(‘avia_relevanssi…’, Array)
    #2 /web/wp-content/themes/enfold/functions-enfold.php(255): apply_filters(‘avf_ajax_search…’, ‘get_posts’, ‘numberposts=5&p…’, Array, Array)
    #3 /web/wp-includes/class-wp-hook.php(286): avia_ajax_search(”)
    #4 /web/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
    #5 /var/www/ in /web/wp-content/themes/enfold/config-relevanssi/class-avia-relevanssi.php on line 70

    #1145846

    Hey,

    Could you please post FTP logins here privately as well so we can look into Relevanssi issue?

    Regards,
    Yigit

    #1145847
    This reply has been marked as private.
    #1145877

    Hi,

    Thanks! However these are WP admin logins. We need FTP logins to access files on your server. We could edit file from WordPress dashboard but if something goes wrong, we would need to fix the files via FTP anyway so it would be safe to have FTP logins.

    Best regards,
    Yigit

    #1145958

    Hi!

    I could reproduce the issue on my local installation and fixed it.
    I wanted to apply it on your website however I am getting “Sorry, you are not allowed to access this page.” when i try to load /wp-admin.

    I will check with our devs and make sure my fix is correct.

    Best regards,
    Yigit

    #1146038

    Hi Yigit,

    Thx for checking back with your guys and good to know that it can be fixed fast.

    Let’s hope there is also a quick fix for the navigation glitch.

    Best,
    El

    #1146054

    Hi,

    Please replace enfold/config-relevanssi/class-avia-relevanssi.php file with this one – https://github.com/KriesiMedia/enfold-library/blob/master/temp_fixes/Enfold_4_6_3/class-avia-relevanssi.php

    Best regards,
    Yigit

    #1146082

    Hey Yigit,

    I just exchanged the files. Unfortunately it still doesn’t work.

    Best,
    El

    #1146086

    Hi,

    It does work on my end. I attached a screenshot in private content field.
    Please flush browser cache and refresh your page a few times :)

    Best regards,
    Yigit

    #1146093

    Hi Yigit,

    sorry – forgot the browser cache ;). Now the search does display all results although we filtered it to only show products. Here is the code in our functions.php. That is no longer working. Users now get a wild mix of blog content, video and products.

    /**
    * Search with Relevanssi
    **/
    function avia_init_relevanssi($function_name, $search_query, $search_parameters, $defaults)
    {
    $function_name = ‘avia_relevanssi_search’;
    return $function_name;
    }
    add_filter(‘avf_ajax_search_function’, ‘avia_init_relevanssi’, 10, 4);

    function avia_relevanssi_search($search_query, $search_parameters, $defaults)
    {
    global $query;
    $tempquery = $query;
    if(empty($tempquery)) $tempquery = new WP_Query();

    $tempquery->query_vars = $search_parameters;
    $tempquery->query_vars[‘post_type’] = ‘product’;

    relevanssi_do_query($tempquery);
    $posts = $tempquery->posts;

    return $posts;
    }

    /**
    * Adding variations to Relevanssi
    **/
    function rlv_index_variation_skus($content, $post) {
    if ($post->post_type == “product”) {
    $args = array(‘post_parent’ => $post->ID, ‘post_type’ => ‘product_variation’, ‘posts_per_page’ => -1);
    $variations = get_posts($args);
    if (!empty($variations)) {
    foreach ($variations as $variation) {
    $sku = get_post_meta($variation->ID, ‘_sku’, true);
    $content .= ” $sku”;
    }
    }
    }

    return $content;
    }
    add_filter(‘relevanssi_content_to_index’, ‘rlv_index_variation_skus’, 10, 2);

    Best,
    El

    #1146633

    Any updates? This is really bad for us and we need this to work!

    Thanks

    #1146988

    Hi!

    Sorry for the delay. The filter in the functions.php file is being overridden by the default theme configuration for the plugin. You have to add this code in the class-avia-relevanssi.php > ajax_search function, around line 119, to limit the search to the product post type:

    $tempquery->query_vars[‘post_type’] = ‘product’;
    

    That snippet should be added right below this line:

    $tempquery->query_vars = $search_parameters;
    

    Or adjust the priority of the filter in the functions.php file so that it overrides the default configuration.

    add_filter(‘avf_ajax_search_function’, ‘avia_init_relevanssi’, 10, 4);
    

    Adjust the priority from 4 to a higher number.

    add_filter(‘avf_ajax_search_function’, ‘avia_init_relevanssi’, 10, 9999);
    

    Best regards,
    Ismael

    #1147104

    Hi there,

    actually both suggestions have no effect. Ideas?

    Best,
    Elmar

    #1147147

    Hi there,

    I rebuilt the index and that seemed to have done the trick. Just as a note for anyone else.

    Best,
    El

    #1147185

    Hi,

    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1147189

    Hi Jordan,

    please close.

    Thx man!

    #1147191

    Hi,

    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 22 posts - 1 through 22 (of 22 total)
  • The topic ‘Relevanssi search broken after update’ is closed to new replies.