empty search / error filtering posts in admin pages
-
Trying to filter posts oder pages on the admin pages (e.g. for date, category) caused wordpress to crash. The error reported was an sql error, caused by an invalid where clause, similar to the subsequent:
… WHERE wp_term_relationships.term_taxonomy_id IN (157)
AND ((()))
AND wp_posts.post_status = ‘publish’) … GROUP BY …Deactivating ‘SearchEverything’ resolved the problem. After re-activating it, I started to debug. In my case, an invalid empty where clause causes the problem, which is generated by
SearchEverything::se_search_default() :
if no search terms are given, the funtion returns ‘()’ as an empty search default.For my needs, I’ve added a hotfix in SearchEverything::se_search_where():
//TODO: Hotfix! with empty search params, se_search_default()='()’
// leading to an invalid where clause … AND ((()))
if ( $searchQuery != ” && $searchQuery != ‘()’ ) {
$where = ” AND ((” . $searchQuery . “)) “;
}Perhaps it’s the same cause for other empty search related errors.
- The topic ‘empty search / error filtering posts in admin pages’ is closed to new replies.