on fresh drupal 6.20 install I get this error and I'm not able to select relevant content to user even if he has some nodes created

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 '= 3' at line 1 query: SELECT nid FROM content_ WHERE = 3 in /var/www/drupal/sites/all/modules/user_backreference/user_backreference.module on line 175.

Comments

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

Can you debug what $db_info gets back from CCK at line 171 please?

mogop’s picture

could you telm me how , pls ? :) i'm not familiar with debugging

joachim’s picture

Install devel module, then add a line:

dpr($db_info);

mogop’s picture

ok ...
i put dpr($db_info); in page.tpl.php but still it's not showing any messages. the error showing when I'm editing profile and after Save give me this too :
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 '= 1' at line 1 query: SELECT nid FROM content_ WHERE = 1 in /var/www/drupal/sites/all/modules/user_backreference/user_backreference.module on line 175.
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 '= 1' at line 1 query: DELETE FROM content_ WHERE = 1 in /var/www/drupal/sites/all/modules/user_backreference/user_backreference.module on line 234.
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 '= 1' at line 1 query: SELECT nid FROM content_ WHERE = 1 in /var/www/drupal/sites/all/modules/user_backreference/user_backreference.module on line 175.

joachim’s picture

No, you put it in the module code on the line I mentioned. In page.tpl that variable doesn't exist!

mogop’s picture

so this:

170    // Get CCK's database info for this field and hence table and field names.	  
171    $db_info = content_database_info($field); dpr($db_info);  
172    $table = $db_info['table'];
173    $column = $db_info['columns']['uid']['column'];

prints this:

Array
(
    [table] => content_
    [columns] => Array
        (
        )

)

if I wrote :

170    // Get CCK's database info for this field and hence table and field names.
171    dpr($db_info);  	  
172    $db_info = content_database_info($field); 
173    $table = $db_info['table'];
174    $column = $db_info['columns']['uid']['column'];

nothing happens, except the error...

joachim’s picture

Um, well of course the second one won't work -- the variable hasn't been set yet at that point! ;)

Have you correctly set up user_backreference_get_fields() ?

Marko B’s picture

I had the same problem, but it was because field wasnt hardcoded in the begining of module.

function user_backreference_get_fields() {
// HARDCODED field name. Put your own here! Or better stillm write a patch for an admin UI! ;)
$field_names = array('field_1dopredsjednik');

then again who would know that this must take places?! some readme file maybe would help?

In the end this works fine but i would like to have support fo multiple fields in the same node and also views do display this, without this module wont be useful much :(

joachim’s picture

> then again who would know that this must take places?! some readme file maybe would help?

There is a really loud warning on the project page that explains this module is missing several key pieces!

> In the end this works fine but i would like to have support fo multiple fields in the same node

What happens if you put several field names into that array?

Marko B’s picture

Just suggesting this should be added somewhere, could help people to exactly know what to do. Why dont you add that information to project page?

I tried with several fields, no change but maybe its should work like that in current mode.

What i wanted to do is to have node type "club" then have node reference fields 5 of them, for example president, manager etc Then to use some member both as president and manager, and then on this memeber profile that it says both. Currently it just states name of the node.

joachim’s picture

Ok I've added that to the project page.

But I think what I state on the project page is clear -- this is work that was done for a specific case, for a single client. I've released it because it goes *some* of the way towards being a general-purpose module that others can use. But it doesn't go *all* the way. I've released it because that way perhaps another developer can do the rest of the work on it, rather than have to start from scratch.

If that's you, you can post patches or talk to me about becoming a co-maintainer :)

Marko B’s picture

Wish that was the case, as i would like to tweek it to my needs, unfortionatly my knowledge is nowhere near that so i wonder around trying to find some solutions for my need :-(