The SQL code in the call to db_rewrite_sql, as of 5.x-1.12, does not include an alias to the node table, which causes a SQL error because of the ambiguity on the nid field. Patch attached.

CommentFileSizeAuthor
nodereference.patch798 bytestherzog

Comments

longwave’s picture

Status: Active » Reviewed & tested by the community

Bug confirmed, patch works for me.

Crell’s picture

I was bitten by this as well, and the attached fix worked for me.

e5sego’s picture

This happend to me too, and the patch works. I believe this bug just appears in combination with i18n module, the failed query looks like:

SELECT title FROM dr59_node  LEFT JOIN dr59_i18n_node i18n ON n.nid = i18n.nid  WHERE (i18n.language ='de' OR i18n.language ='' OR i18n.language IS NULL) AND ( nid=11330) 
longwave’s picture

The bug is triggered when using any module that implements hook_db_rewrite_sql() - in my case it was due to Domain Access, not i18n.

jtjones23’s picture

This bug was driving me crazy, patch works for me as well.

abautu’s picture

I got this problem too. I created a similar patch (which I'm not attaching because therzog beat me to it :P )

greg.harvey’s picture

longwave’s picture

shawn dearmond’s picture

Yup, patch works. Thanks!

karens’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

The D5 version is no longer being supported. Sorry.