Active
Project:
Category
Version:
master
Component:
Wrapper modules
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2007 at 15:23 UTC
Updated:
28 Apr 2007 at 17:48 UTC
When I submit an article with freetagging, it will show the warning message.
If the taxonomy wrapper is uninstall, the warning message will disappear.
php 5.0
drupal 5.2-dev
user warning: Unknown column 'Object' in 'field list' query: INSERT INTO term_node (nid, tid) VALUES (68, Object) in /var/www/includes/database.mysqli.inc on line 151.
Comments
Comment #1
2houseplague commentedhttp://drupal.org/node/91967
Comment #2
sjh-1 commentedThe symptoms are bit different to what I'm seeing, but from the code it looks a product of exactly the issue I've been looking at. It has to do with the taxonomy field of the node structure being initialised directly from the value in the category field. The problem is that tid then doesn't exist, and the insertion code that is lifted directly from the taxonomy module expects it to be there if $node->taxonomy is an object.
My patch for it is at http://drupal.org/node/87669#comment-225000
Comment #3
dingbats commentedI looked inside the taxonomy wrapper module. At the bottom of the taxonomy_node_save function, there is a foreach loop that iterates over $terms:
Let's examine the structure of a category object (a var_dump of $terms)
Looking at the conditional statement in the taxonomy_node_save function, we see that because the object in $terms isn't an array, nor does it have an attribute 'tid', the last condition is true (i.e., the object is not null) and this is parsed:
Of course, $term is not an integer, but a category object, so it is converted to the string, 'Object' and substituted into the query. For me $term is substituted as '1', probably because of my php version. And, consequently, the mysql error I receive is:
Duplicate entry '1-12' for key 1 query: taxonomy_node_save INSERT INTO term_node (nid, tid) VALUES (12, 1) in database.mysql.inc on line 172.
I can see two solutions for this problem, however, I don't know enough about the taxonomy or category modules to decide which is more appropriate:
Please suggest any other alternatives so we can quickly patch this issue up.
Comment #4
inforeto commentedFor patching to those structures see here:
http://drupal.org/node/87669
The original post don't seem a duplicate, but might be related.