Last modified: 2010-05-15 15:41:17 UTC
1st off my system is running MediaWiki: 1.7.1 PHP: 5.1.4-0.1 (cgi-fcgi) MySQL: 5.0.22-Debian_3-log I get the following error when loading the Special:Newimages (Gallery of new files) "A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "wfSpecialNewImages". MySQL returned error "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') WHERE ug_group IS NULL ORDER BY img_timestamp DESC LIMIT 1' at line 1 (localhost)"." Can anyone help as this is a important feature for my wiki site
It would help if we could see the complete query that is being run. Add this line to your LocalSeetings.php file: $wgShowSQLErrors = true; then reload the page and post the SQL here (it will replace the "SQL query hidden" text above.
Thanks for the quick reply here is the info you need A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: SELECT img_timestamp from `image` LEFT OUTER JOIN `user_groups` ON img_user=ug_user AND () WHERE ug_group IS NULL ORDER BY img_timestamp DESC LIMIT 1 from within function "wfSpecialNewImages". MySQL returned error "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') WHERE ug_group IS NULL ORDER BY img_timestamp DESC LIMIT 1' at line 1 (localhost)".
Looks like you have no bots defined in your group permissions. Adding them back in should fix this. Add this line to either LocalSettings.php or back into DefaultSettings.php, where it was: $wgGroupPermissions['bot' ]['bot'] = true; I'll commit a patch in a second to more gracefully handle the case in where one has no bot permissions.
Fixed in revision 16002.
Thanks for that want to confirm that was fixed The bot was in the defaultsettings.php but i had been adding grouppermissions into the localsettings.php to change them. Bot permissions where not in my edits. I thought that if it is not in localsettings it will use what is in default settings. Oh well thanks again for the quick resolution
*** Bug 6959 has been marked as a duplicate of this bug. ***