On a multi-language side I get for 'admin/content/comment/moderation' these errors and the displayed queue is empty:
user warning: Unknown column 'n.language' in 'where clause' query: SELECT COUNT(*) FROM comments c LEFT JOIN moderation_moderation mm ON c.cid = mm.obj_id LEFT JOIN node i18n ON n.tnid > 0 AND n.tnid = i18n.tnid AND i18n.language = 'en' WHERE (n.language ='en' OR n.language ='' OR n.language IS NULL OR n.language = 'de' AND i18n.nid IS NULL) AND ( mm.obj_type = 'comment' AND (mm.status IS NULL OR mm.status=0) ) in /home/lilly-mi/public_html/sites/all/modules/moderation/moderation.moderation.inc on line 96.
user warning: Unknown column 'n.language' in 'where clause' query: SELECT c.*, mm.status as moderate FROM comments c LEFT JOIN moderation_moderation mm ON c.cid = mm.obj_id LEFT JOIN node i18n ON n.tnid > 0 AND n.tnid = i18n.tnid AND i18n.language = 'en' WHERE (n.language ='en' OR n.language ='' OR n.language IS NULL OR n.language = 'de' AND i18n.nid IS NULL) AND ( mm.obj_type = 'comment' AND (mm.status IS NULL OR mm.status=0) )ORDER BY c.timestamp DESC, c.subject ASC LIMIT 0, 50 in /home/lilly-mi/public_html/sites/all/modules/moderation/moderation.moderation.inc on line 96.
What can I do?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | moderation.moderation_new.patch | 593 bytes | stevehuk |
Comments
Comment #1
bjcool commentedShow stopper for I18N -> raise prio
Comment #2
bjcool commentedSome i18n permissions were missing.
Comment #3
bjcool commentedCLosing
Comment #4
neurovation.kiwi commentedreopening that bug - cause the explanation dosn't fit my experience.
actually there might be a permission problem - but the bigger problem is, the db_rewrite_sql() !
in case of the comment, there are some params missing:
- primary table
- primary field
per default those are 'n' and 'nid' - but in case of the comments those should read 'c' and 'cid'!
please change the code in moderation.moderation.inc in function moderation_comment_queue() at line 97
from
to
cu
kiwi
Comment #5
neurovation.kiwi commentedwell, just have to correct myself...
just found out that when using some node_access modules my presented solution is not really a solution.
so - best would be if you change the sql statement - not the rewrite statement:
i included the corresponding node - in order for the node_access modules to kick in correctly!
cu
kiwi
Comment #6
stevehuk commentedJust to note that this fix also worked when I got a similar message:
Unknown column 'n.nid' in 'on clause'Changing the SQL as suggested in #5 did the job for me. In case it might be of use, a patch file is attached.
It would be good if this change could be checked and committed into the 1.* dev line, though I see that there is now a 2.x branch so if the new version is ready for use soon it may not be needed. A proper fix would be good - my users really like this modules approach to moderation.
Comment #7
neurovation.kiwi commentedif stevehuk's review is sufficient - please commit the change!
Comment #8
sanduhrsCommited to 6-DEV.
Thanks.