Using Drupal 5 / HEAD, I cannot use nodereferrer.module. When saving a node which has a nodereferrer field, I get an error message like the following one:
user 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 '= 15 ORDER BY n.created DESC' at line 4 query: nodereferrer_referrers SELECT DISTINCT(n.nid), n.vid, n.title FROM node_data_ nr INNER JOIN node n ON n.vid = nr.vid AND n.status = 1 AND n.type IN ('0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0') WHERE nr. = 15 ORDER BY n.created DESC in includes/database.mysql.inc on line 167.
I looked at the documentation but I didn't find any "Upgrade your CCK module from 4.7 to 5" page.
in the query, one has nr. = 15 where 15 is the nid, but where $db_info['columns']['nid']['column'] is empty.
$query = "SELECT n.nid, n.vid, n.title
FROM {" . $db_info['table'] . "} nr
INNER JOIN {node} n ON n.vid = nr.vid AND n.status = 1 ". $filter_nodetypes ."
WHERE nr." . $db_info['columns']['nid']['column'] . " = %d
ORDER BY n.created DESC";
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | unset_zero_values_nodereferrer.diff | 865 bytes | beginner |
Comments
Comment #1
beginner commentedsolved with:
http://drupal.org/node/107482
Comment #2
beginner commentedHmmm, no.
This error is coming back despite the upgrade patch mentioned... I am looking into it...
Comment #3
beginner commentedThe problem is related to the fact that the fields that are not supposed to be set, are actually attributed the value 0.
Thus, instead of having something like:
we get something like this:
I am not familiar with the cck API, so I am not sure if it's a problem with this module, or a problem with content.module.
Comment #4
beginner commentedThe solution is to check for zero values and unset them.
It may be a content.module bug, but I only found a solution within nodereferrer.
It may not be the best fix, but it works for now. The problem is that i don't know enough of the CCK API.
Comment #5
beginner commentedI filed this report against content.module:
http://drupal.org/node/107658
Comment #6
beginner commentedComment #7
dopry commentedtnx, committed with #139293 v1.5.
Comment #8
(not verified) commented