Whenever I want to delete a nodefile relationship I get something similar to this:

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 'SELECT nid FROM node WHERE type ='usernode') AND child_nid IN ( query: DELETE FROM nodefamily WHERE parent_nid IN (SELECT nid FROM node WHERE type ='usernode') AND child_nid IN (SELECT nid FROM node WHERE type ='content_research_profile_staff') in /homepages/18/d126859316/htdocs/newSiteDevelopment/Drupal/includes/database.mysql.inc on line 121.

I have to empty the nodefile table manually in order to properly get rif of any unwanted relationships.
(Drupal 4.7.4)

Comments

aclight’s picture

I've seen error messages similar to this one from nodefamily and other modules when I did things with nodes that weren't good. The errors really had nothing directly to do with nodefamily or the other module, that's just what resulted from the original example. For example, I had a CCK node type that was part of a nodefamily relationship that had a few computed fields that wrote information to the user's profile. I also had a hook_user implementation in one of my modules that created certain nodes (including the one with the computed fields) whenever a new user logged in. However, the code for those computed fields wasn't quite right, and sometimes I got into a situation where I was recursively creating nodes and things like that.

So, I know this may not be all that useful to you, but check any modules you have written yourself (especially those that implement hook_user or that implement the nodeapi), and make sure that if you have any computed fields in the nodes you are trying to delete, that the code in the computed fields isn't causing the problem.

AC

Axel_V’s picture

It happens whenever I try to delete any nodefamily relationship and I wouldn't actually dare to touch things as complicated as computed fields. That doesn't mean though that I haven't made any mistake anywhere. I'll see if I can find it. Otherwise it is not such a big issue. As long as I don't touch the relationships everything works fine.
xl

fago’s picture

Title: Problems with deleting nodefile relationships » deleting nodefamily relations requires mysql > 4.1

Probably your using mysql < 4.1

I just recognized that I've used subqueries for deleting the nodefamily relationships. This won't work if you use a mysql version that can't deal with subqueries. I think they are available since 4.1

fago’s picture

my last post was cut by the filter, so again:

Probably your using mysql version before 4.1.
I've just recognized that I've done the deletion of nodefamily relationships with subqueries. So probably your query fails because your mysql isn't capable of subqueries. I think they were introduced with mysql 4.1

Axel_V’s picture

That explains a lot. my provider runs MySQL version 4.0.
cheers, xl