SQL Error when searching products in Bear Bulk Editor
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from MAJMonaco on March 6, 2025, 16:16Hello Bear Bulk Editor Support,
I am encountering an SQL syntax error when trying to search products using Bear Bulk Editor within my WooCommerce store.
Here is the exact error message returned:
WordPress database error:
[You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')
ORDER BY wp_1971419420_posts.post_title ASC
LIMIT 0, 10' at line 3]SELECT SQL_CALC_FOUND_ROWS wp_1971419420_posts.ID
FROM wp_1971419420_posts
WHERE 1=1 AND wp_1971419420_posts.post_type = 'product 'AND ((wp_1971419420_posts.post_status = 'publish 'OR wp_1971419420_posts.post_status = 'future 'OR wp_1971419420_posts.post_status = 'draft 'OR wp_1971419420_posts.post_status = 'pending 'OR wp_1971419420_posts.post_status = 'private ')) AND ( )
ORDER BY wp_1971419420_posts.post_title ASC
LIMIT 0, 10Issue Analysis:
- There seems to be an extra whitespace after
'product 'and after each post status ('publish ','draft ', etc.).- Additionally, there's an empty clause (
AND ( )) causing the SQL syntax to fail.Steps already tried:
- Resetting all search filters within the Bear Bulk Editor interface.
- Checking for conflicts with other plugins/themes.
- Ensuring Bear Bulk Editor and WooCommerce are up-to-date.
Could you please investigate this issue and advise on a fix or workaround?
Thank you very much for your support,
Hello Bear Bulk Editor Support,
I am encountering an SQL syntax error when trying to search products using Bear Bulk Editor within my WooCommerce store.
Here is the exact error message returned:
WordPress database error:
[You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')
ORDER BY wp_1971419420_posts.post_title ASC
LIMIT 0, 10' at line 3]
SELECT SQL_CALC_FOUND_ROWS wp_1971419420_posts.ID
FROM wp_1971419420_posts
WHERE 1=1 AND wp_1971419420_posts.post_type = 'product 'AND ((wp_1971419420_posts.post_status = 'publish 'OR wp_1971419420_posts.post_status = 'future 'OR wp_1971419420_posts.post_status = 'draft 'OR wp_1971419420_posts.post_status = 'pending 'OR wp_1971419420_posts.post_status = 'private ')) AND ( )
ORDER BY wp_1971419420_posts.post_title ASC
LIMIT 0, 10
Issue Analysis:
- There seems to be an extra whitespace after
'product 'and after each post status ('publish ','draft ', etc.). - Additionally, there's an empty clause (
AND ( )) causing the SQL syntax to fail.
Steps already tried:
- Resetting all search filters within the Bear Bulk Editor interface.
- Checking for conflicts with other plugins/themes.
- Ensuring Bear Bulk Editor and WooCommerce are up-to-date.
Could you please investigate this issue and advise on a fix or workaround?
Thank you very much for your support,
Quote from MAJMonaco on March 6, 2025, 16:34I have temporarily corrected the problem as follows:
// Correctif pour l'erreur SQL de Bear Bulk Editor
add_filter('posts_where', 'fix_bear_bulk_editor_query', 999, 2);
function fix_bear_bulk_editor_query($where, $query) {
// Corriger les espaces en trop dans les valeurs
$where = preg_replace("/post_type\s*=\s*'([^']+)\s+'/", "post_type = '$1'", $where);
$where = preg_replace("/post_status\s*=\s*'([^']+)\s+'/", "post_status = '$1'", $where);// Supprimer les clauses vides
$where = str_replace("AND ( )", "", $where);return $where;
}
I have temporarily corrected the problem as follows:
// Correctif pour l'erreur SQL de Bear Bulk Editor
add_filter('posts_where', 'fix_bear_bulk_editor_query', 999, 2);
function fix_bear_bulk_editor_query($where, $query) {
// Corriger les espaces en trop dans les valeurs
$where = preg_replace("/post_type\s*=\s*'([^']+)\s+'/","post_type = '$1'", $where);
$where = preg_replace("/post_status\s*=\s*'([^']+)\s+'/","post_status = '$1'", $where);
// Supprimer les clauses vides
$where = str_replace("AND ( )","", $where);
return $where;
}
Quote from Pablo Borysenco on March 7, 2025, 11:32Hello
Thank you for your cooperation!
What plugin version number are you using?
Hello
Thank you for your cooperation!
What plugin version number are you using?
Quote from MAJMonaco on March 7, 2025, 12:05Hello, Version 2.1.4.5
Hello, Version 2.1.4.5
Quote from Pablo Borysenco on March 7, 2025, 13:20Ok! We will fix this in the next version of the plugin.
Ok! We will fix this in the next version of the plugin.
Quote from MAJMonaco on March 7, 2025, 16:16Ok, thanks! Do you know when the next version would be available ?
Ok, thanks! Do you know when the next version would be available ?
Quote from Pablo Borysenco on March 10, 2025, 11:46Hello
Unfortunately I don't know the date, at the moment the list of tasks for the new version is being formed
Hello
Unfortunately I don't know the date, at the moment the list of tasks for the new version is being formed
Quote from admin on April 25, 2025, 19:17Hello
Update is done, please do tests
Hello
Update is done, please do tests
Quote from MAJMonaco on April 25, 2025, 19:32Hi,
It seems to work, but I still have a problem. When I search and nothing matches, I shouldn't have all the products displayed.
Hi,
It seems to work, but I still have a problem. When I search and nothing matches, I shouldn't have all the products displayed.
Quote from Pablo Borysenco on April 28, 2025, 09:40Hello
Please describe this problem in more detail.
Hello
Please describe this problem in more detail.
Quote from MAJMonaco on June 24, 2025, 15:59Hello,
Sorry for the late reply.
I have the latest version of the plugin installed, and when I search for something and nothing matches, there should be nothing in the list/displayed as nothing matching. Currently, it displays a list of all products.
https://share.cleanshot.com/nhZ4WqNg
Hello,
Sorry for the late reply.
I have the latest version of the plugin installed, and when I search for something and nothing matches, there should be nothing in the list/displayed as nothing matching. Currently, it displays a list of all products.
Quote from Pablo Borysenco on June 25, 2025, 10:57Hello
Please try this( https://share.pluginus.net/image/i20250625115708.png ) - https://bulk-editor.com/document/more-settings-implicit
Hello
Please try this( https://share.pluginus.net/image/i20250625115708.png ) - https://bulk-editor.com/document/more-settings-implicit
Quote from Pablo Borysenco on June 25, 2025, 12:23Please drop me wp-admin access - https://share.pluginus.net/image/i20230222134241.png ->https://share.pluginus.net/image/i20230222134615.png - I will check it
Please drop me wp-admin access - https://share.pluginus.net/image/i20230222134241.png ->https://share.pluginus.net/image/i20230222134615.png - I will check it
Quote from Pablo Borysenco on June 26, 2025, 11:18Hello
Try in file - \wp-content\plugins\woo-bulk-editor\ext\filters\filters.php - please add this code - https://share.pluginus.net/image/i20250626121821.png
} else {
$sku_where .= " $wpdb->posts.ID IN(-1)";
}
Hello
Try in file - \wp-content\plugins\woo-bulk-editor\ext\filters\filters.php - please add this code - https://share.pluginus.net/image/i20250626121821.png
} else {
$sku_where .=" $wpdb->posts.ID IN(-1)";
}