Forums › Forums › Search & Filter Pro › Relevanssi Premium 1.16
Tagged: No results, relevanssi
- This topic has 23 replies, 4 voices, and was last updated 6 years, 9 months ago by Ross.
-
Anonymous(Private) September 8, 2017 at 3:12 pm #130056
Since the update to Relevanssi Pro 1.16 filtering results with S&F Pro fails. No results are found.
Relevanssi Premium has changed no only the way it hooks into the query ( filter the_posts instead of global $wp_query) but also some filter priorities. S&F Pro removes some of the filters to add/modify query arguments. My strong guess is the removal fails due to changed priorities and the Relevanssi defaults overwrite the filtered result set from S&F Pro. I haven’t verified this to save my customer some money and because S&F Pro officially integrates with Relevanssi which will need some modifications anyway due to the update.
Anonymous(Private) September 8, 2017 at 3:26 pm #130059Verified.
In class Search_Filter_Third_Party you need to replace
remove_filter(‘the_posts’, ‘relevanssi_query’);
remove_filter(‘posts_request’, ‘relevanssi_prevent_default_request’, 9);
remove_filter(‘posts_request’, ‘relevanssi_prevent_default_request’);
remove_filter(‘query_vars’, ‘relevanssi_query_vars’);with
remove_filter(‘the_posts’, ‘relevanssi_query’, 99);
remove_filter(‘posts_request’, ‘relevanssi_prevent_default_request’, 10);
remove_filter(‘query_vars’, ‘relevanssi_query_vars’);to make Relevanssi Premium 1.16 and above to play nicely with S&F Pro.
Anyway this should be tested in more detail to make sure there are no further issues.
Regards
Michael
Anonymous(Private) September 10, 2017 at 11:52 am #130224Hello!
It seems like we have the same problem with Relevanssi and Search and filter pro. This sounds like the solution for us too!
Where am I suppose to add this code? Is it in the plugin files?
In class Search_Filter_Third_Party you need to replace
remove_filter(‘the_posts’, ‘relevanssi_query’);
remove_filter(‘posts_request’, ‘relevanssi_prevent_default_request’, 9);
remove_filter(‘posts_request’, ‘relevanssi_prevent_default_request’);
remove_filter(‘query_vars’, ‘relevanssi_query_vars’);with
remove_filter(‘the_posts’, ‘relevanssi_query’, 99);
remove_filter(‘posts_request’, ‘relevanssi_prevent_default_request’, 10);
remove_filter(‘query_vars’, ‘relevanssi_query_vars’);When do you think this will be updated?
Thanks a lot!
Anonymous(Private) September 10, 2017 at 12:07 pm #130226Christoffer the code replacement would have to be done in /search-filter-pro/includes/class-search-filter-third-party.php within the function remove_relevanssi_defaults().
But as I wrote this was just a quick research about the root cause of the problem I mentioned. More research has to be done to make sure the modification itself won’t cause other issues. Saying this I do not recommend applying this ‘patch’ for now especially if you are not a developer with good knowledge in wordpress plugin development and advanced knowledge of S&F and Relevanssi code.
Please consider my post as a hint for Ross (S&F developer) as a starting point to save him time troubleshooting the issue.
My recommendation is to downgrade to Relevanssi 1.15.4 until S&F gets an update to address the changes in Relevanssi 1.16. You can get previous versions of the plugin at https://www.relevanssi.com/download/.
-
AuthorPosts