SQL Syntax Error caused by SELECT SQL_CALC_FOUND_ROWS all in WPPostDriver
-
Hi NextGEN Team,
we’re encountering a critical SQL syntax error caused by NextGEN Gallery (version 3.59.10) on our WordPress installation:
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 'FROM xy_posts WHERE 1=1 ...' Query: SELECT SQL_CALC_FOUND_ROWS all FROM xy_posts WHERE ...Upon investigation, it seems that the issue originates from the
Imagely\NGG\DataMapper\WPPostDriverclass. When building the query, thefieldsparameter is being set to'all', which is not valid SQL.Expected:
SELECT SQL_CALC_FOUND_ROWS * FROM ...But the plugin generates:
SELECT SQL_CALC_FOUND_ROWS all FROM ...We confirmed that:
- The issue is not caused by the theme (tested with Twenty Twenty-Five 1.2)
- Other plugins do not interfere
- The error appears both in the frontend and backend when NextGEN Gallery is active
Temporary workaround: We tried this filter in
functions.php, but it didn’t solve the issue reliably:add_filter('posts_fields', function ($fields) { return $fields === 'all' ? '*' : $fields; }, 0);We’d appreciate a fix or guidance on how to prevent
'all'from being passed as a field in the query.Best regards,
EricThe page I need help with: [log in to see the link]
The topic ‘SQL Syntax Error caused by SELECT SQL_CALC_FOUND_ROWS all in WPPostDriver’ is closed to new replies.