SQL error and no nodes showing up in nmoderation list
| Project: | Node Moderation |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
This actually seems to be the same error as reported in node/22047 but I'm repeating it because this is happening on 4.7 and it didn't seem right to hijack that post as it is still ongoing.
Using 4.7 CVS as of today (ALL latest files!) and latest CVS version of nmoderation. Everything seems to work fine except visiting nmoderation/all or admin/nmoderation in which case no nodes that have had votes appear and the following SQL error displays at the top of the page.
Warning: 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 'DISTINCT(n.nid), n.created, n.title, v.uid, u.name FROM votingapi_vote v INNER J' at line 1 query: SELECT nv.vote, v.value, v.vote_id, DISTINCT(n.nid), n.created, n.title, v.uid, u.name FROM votingapi_vote v INNER JOIN nmoderation_votes nv ON v.value = nv.mid INNER JOIN node n ON v.content_id = n.nid AND v.content_type = 'node' AND v.value_type = 'option' INNER JOIN users u ON v.uid = u.uid WHERE n.status = 1 ORDER BY created DESC LIMIT 0, 50 in /var/www/includes/database.mysql.inc on line 120
I have voting_api installed (latest version), as well as views. Taxonomy access is controlling node creation rights and Organic Groups is controlling node access (these two are playing nicely together in the corner and have done for a while - not causing any noticeable trouble with any other modules).
Incidentally, there are also no nodes showing up under "my unmoderated nodes" either but nmoderation was installed after the creation of every node currently on the site. I don't know if this is why, but I'll test.
I just need a solution to the SQL error first... :)

#1
I haven't encountered this error in testing or development, but I'm not using any access control modules. I'll take a look at the code to be sure that it isn't stomping on territory those modules want to control with some of its queries. Is there any way you can test this out *without* those modules turned on? If not, no sweat -- I'm just trying to figure out if it's specifically related to them, or some other issue
#2
Eaton,
I can, but it will take me a while - I can't test it on vcommunity because the site's live - yeah, I know... I'll slap my own wrist :)
I'll try and put aside some time next week to build a clean install and test properly. Unless you beat me to it!
Regards
Patrick
#3
I had this same error. But I didn't have OG enabled. I did have taxonomy_access enabled. When I deactivate taxonomy_access module and then remove it from admin >> modules I can confirm the sql error goes away.
regards
--AjK
#4
Closing stale issue. Moved on a long when since then (we now have an access abstraction system since D5).