I have loaded nmoderation module version (// $Id: nmoderation.module,v 1.8 2004/10/13 14:14:01 weitzman Exp $) and drupal 4.5rc.

i have the following error, when i navigate to http://mysite/?q=admin/nmoderation
<------------------------------------
user error: You have an error in your SQL syntax near 'ON nmuv.mid = v.mid JOIN node n ON nmuv.gid = n.nid AND nmuv.realm = 'node_nid' ' at line 1
query: SELECT COUNT(*) FROM nmoderation_uservotes nmuv JOIN nmoderation_votes v ON nmuv.mid = v.mid JOIN node n ON nmuv.gid = n.nid AND nmuv.realm = 'node_nid' JOIN users u ON nmuv.uid = u.uid WHERE n.status = 1 in database.mysql.inc on line 125.

user error: You have an error in your SQL syntax near 'ON nmuv.mid = v.mid JOIN node n ON nmuv.gid = n.nid AND nmuv.realm = 'node_nid' ' at line 1
query: SELECT v.vote, nmuv.value, nmuv.uvid, n.nid, n.title, nmuv.uid, u.name FROM nmoderation_uservotes nmuv JOIN nmoderation_votes v ON nmuv.mid = v.mid JOIN node n ON nmuv.gid = n.nid AND nmuv.realm = 'node_nid' JOIN users u ON nmuv.uid = u.uid WHERE n.status = 1 ORDER BY title ASC LIMIT 0, 50 in database.mysql.inc on line 125.
----------------------------------->

I entered values as,

(?q=admin/nmoderation/votes)
moderation votes : good
weight : 1

(?q=admin/nmoderation/roles)
then went to moderation roles:
i got automatically user role as
admin : 1 (editable field)

in moderation matrix:
(?q=admin/nmoderation/matrix)
the votes value is already present ie., good (in our example)
admin : 1 (editable field)

Now when i click on list (?q=admin/nmoderation)
i get those query errors again,
how to go about it.

And i am not sure if the above test values that i entered are right.
I would appreciate if someone can illustrate with an example. Which i am sure will support the documentation of this module later.

Database tables nmoderation_votes, nmoderation_roles) have values in it.
Still nmoderation_filters and nmoderation_uservotes has no values.

CommentFileSizeAuthor
#5 nmoderation_joins.patch3.44 KBgrohk

Comments

gkrishna’s picture

Title: Query error: Need documentation support » Query error posted here

i didnt mention the database query error in the previous post, its here,

user error: You have an error in your SQL syntax near 'ON nmuv.mid = v.mid JOIN node n ON
nmuv.gid = n.nid AND nmuv.realm = 'node_nid' ' at line 1
query: SELECT COUNT(*) FROM nmoderation_uservotes nmuv JOIN nmoderation_votes v ON nmuv.mid
= v.mid JOIN node n ON nmuv.gid = n.nid AND nmuv.realm = 'node_nid' JOIN users u ON nmuv.uid
= u.uid WHERE n.status = 1 in database.mysql.inc on line 125.

user error: You have an error in your SQL syntax near 'ON nmuv.mid = v.mid JOIN node n ON
nmuv.gid = n.nid AND nmuv.realm = 'node_nid' ' at line 1
query: SELECT v.vote, nmuv.value, nmuv.uvid, n.nid, n.title, nmuv.uid, u.name FROM
nmoderation_uservotes nmuv JOIN nmoderation_votes v ON nmuv.mid = v.mid JOIN node n ON
nmuv.gid = n.nid AND nmuv.realm = 'node_nid' JOIN users u ON nmuv.uid = u.uid WHERE n.status
= 1 ORDER BY title ASC LIMIT 0, 50 in database.mysql.inc on line 125.

----------------------------->

Following in the cvs of mysql tables
http://cvs.drupal.org/viewcvs/*checkout*/contributions/modules/nmoderati...

its strange that nmoderation_filters table though created but never used in module here,
http://cvs.drupal.org/viewcvs/*checkout*/contributions/modules/nmoderati...

any thoughts/suggestions

gkrishna’s picture

Title: Query error posted here » Configuration followed comment module

update.....

Regarding configuration of nmoderation, i followed the steps as given for comment module.
http://drupal.org/book/print/286

though query error is still not fixed...

gkrishna’s picture

Title: Configuration followed comment module » Fixed the sql query error
Assigned: Unassigned » gkrishna

i have added keyword "INNER" (without quotes) before "join" in all the sql queries to fix the query error.

Anonymous’s picture

grohk’s picture

Title: Fixed the sql query error » Correct the syntax of the Joins in the nmoderation queries
Component: Documentation » Code
Assigned: gkrishna » grohk
Category: support » bug
Priority: Critical » Normal
StatusFileSize
new3.44 KB

This bug seems to still be biting some people for some reason. I did some research and I reviewed this page:

http://drupal.org/node/2041

Does this patch that adds 'INNER' to the JOINS need to be applied to fix the problem?

jpwillms’s picture

I still have the same problem....

user error: You have an error in your SQL syntax near 'ON nmuv.mid = v.mid JOIN node n ON nmuv.gid = n.nid AND nmuv.realm = 'node_nid' ' at line 1
query: SELECT COUNT(*) FROM nmoderation_uservotes nmuv JOIN nmoderation_votes v ON nmuv.mid = v.mid JOIN node n ON nmuv.gid = n.nid AND nmuv.realm = 'node_nid' JOIN users u ON nmuv.uid = u.uid WHERE n.status = 1 in /home/httpd/vhosts/jordanwillms.com/httpdocs/drupal/includes/database.mysql.inc on line 66.
user error: You have an error in your SQL syntax near 'ON nmuv.mid = v.mid JOIN node n ON nmuv.gid = n.nid AND nmuv.realm = 'node_nid' ' at line 1
query: SELECT v.vote, nmuv.value, nmuv.uvid, n.nid, n.created, n.title, nmuv.uid, u.name FROM nmoderation_uservotes nmuv JOIN nmoderation_votes v ON nmuv.mid = v.mid JOIN node n ON nmuv.gid = n.nid AND nmuv.realm = 'node_nid' JOIN users u ON nmuv.uid = u.uid WHERE n.status = 1 ORDER BY created DESC LIMIT 0, 50 in /home/httpd/vhosts/jordanwillms.com/httpdocs/drupal/includes/database.mysql.inc on line 66.

grohk’s picture

jpwillms, you have not applied the patch that I have provided yet. Please do so and then post here if it does or does not correct your issue.

grohk’s picture

Setting to patch.

moshe weitzman’s picture

Anonymous’s picture