-
AuthorPosts
-
October 1, 2019 at 10:13 am #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,
ElOctober 3, 2019 at 7:56 pm #1144603Hi there,
Please help as search is still not working since the latest update.
Best,
ElOctober 6, 2019 at 8:22 pm #1145496Hi,
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,
BasilisOctober 7, 2019 at 5:52 am #1145617Hi 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,
ElOctober 7, 2019 at 5:54 am #1145618October 7, 2019 at 1:56 pm #1145757Here 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 70October 7, 2019 at 5:00 pm #1145846Hey,
Could you please post FTP logins here privately as well so we can look into Relevanssi issue?
Regards,
YigitOctober 7, 2019 at 5:13 pm #1145847This reply has been marked as private.October 7, 2019 at 6:48 pm #1145877Hi,
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,
YigitOctober 7, 2019 at 11:12 pm #1145958Hi!
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,
YigitOctober 8, 2019 at 7:43 am #1146038Hi 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,
ElOctober 8, 2019 at 9:04 am #1146054Hi,
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,
YigitOctober 8, 2019 at 9:53 am #1146082Hey Yigit,
I just exchanged the files. Unfortunately it still doesn’t work.
Best,
ElOctober 8, 2019 at 9:57 am #1146086Hi,
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,
YigitOctober 8, 2019 at 10:14 am #1146093Hi 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,
ElOctober 9, 2019 at 8:33 pm #1146633Any updates? This is really bad for us and we need this to work!
Thanks
October 11, 2019 at 3:16 am #1146988Hi!
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,
IsmaelOctober 11, 2019 at 12:50 pm #1147104Hi there,
actually both suggestions have no effect. Ideas?
Best,
ElmarOctober 11, 2019 at 4:24 pm #1147147Hi there,
I rebuilt the index and that seemed to have done the trick. Just as a note for anyone else.
Best,
ElOctober 11, 2019 at 5:58 pm #1147185Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan ShannonOctober 11, 2019 at 6:04 pm #1147189Hi Jordan,
please close.
Thx man!
October 11, 2019 at 6:26 pm #1147191Hi,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Relevanssi search broken after update’ is closed to new replies.