I am testing the nodeperm_role.module and I experienced an SQL error when node permissions are changed.

The problem is that the query in question uses "INNER JOIN {term_node} USING (tid)" but the db_rewrite_sql() function adds another inner join in front of this one so the USING clause breaks. My patch changes all the USING statements to ON to prevent this.

Perhaps the documentation for db_rewrite_sql() should be updated to warn against the use of the USING clause. I don't see any other instances of it in core but many contrib modules use it.

CommentFileSizeAuthor
#1 nodeaccess_0.patch1.21 KBchx
nodeaccess.patch1.21 KBtangent

Comments

chx’s picture

StatusFileSize
new1.21 KB

Handbook updated, thanks for warning. +1 on this.

tangent’s picture

Can we get this commited? It's a pretty critical error.

dries’s picture

This block is no more.

Anonymous’s picture