Category is not workin at all with the drupal Forums. If I install Category before forums, the forum posts are not able to be submitted to a category - ie there is NO category selection area. If I install Category after forums then I lose all taxonomy associated with the forums, and it still doesnt work even after I create new forum containers and forums.

Why can category not work within the constraints and functionality of the taxonomy module? Why must it Wrap the taxonomy? Just about all Drupal modules utilize the taxonomy module for the taxonomy structure. By creating a new type of taxonomy, category strips away the ability of many many modules to interface with any type of taxonomy, thus making other modules good only for taking up space in the DB and HD.

I hope that someone is planning on comming out with a category module that works sometime, it would be nice.

newbies - use taxonomy, not category... Unless you like to install and uninstall your site several times in an effort to try to get category working with the rest of your site or unless you are a masochist.

Comments

bdragon’s picture

Remember to enable the "Maintain category data in taxonomy tables" option in administer >> settings >> category / Taxonomy wrapper settings.

Category wraps book and taxonomy because it is a replacement for the book and taxonomy modules.

And yes, this module is not recommended for newbies, there's waay too many ways to shoot yourself in the foot at the moment.

derekwebb1’s picture

Well for the time being I'll just use views and taxonomy. The funny thing is, I have three other sites that run Cat just fine. Thats why it blows my mind. I reinstalled probably 8 times doing things differently each time and no luck! Arrrrgh!

marcoBauli’s picture

silly question: have you enabled the "forum topic" content type in your "Forum" container settings?

derekwebb1’s picture

Yes as a matter of fact I did.

nschandler’s picture

I am having a similar issue.

Fresh Drupal 4.7.3 installed. Ensured that Taxonomy and Books enabled then enabled Category module. Setup Category plus wrappers then enabled Forums.

Validated that the description of the Taxonomy and Books modules had changed in the Admin/Modules

Validated that a new container, forum had been created in categories and was valid for 'forum topic'.

Created new Forum through the Admin/Forums (not as a category under the Container 'Forums')

Validated that the Forum name appears as a category under the container 'Forums'.

Went to post a new topic to the created forum and recieved the following error when publishing.

"Message Unknown column 'Object' in 'field list' query: INSERT INTO term_node (nid, tid) VALUES (3, Object) in /MYSITE/includes/database.mysql.inc on line 120."

Node is created, but does not appear as part of the Forum.

Thanks.

OpenChimp’s picture

I have a related problem on my server. See http://www.drupal.org/node/91967 for my origninal post. I've been busy fixing higher priority issues, but I'm about to dive into this bug to see if I can figure it out. I found your post, and figured I'd add my two cents since I'm getting an almost identical error.

Workaround

As a temporary workaround, to fix this problem I manually copy the values from category_node into term_node, which makes the values visible to all the other modules that use taxonomy. The problem is that any update to the node will delete the term_node entry for that node, disassociating the node from that taxonomy and thus breaking the site, but as long as you don't modify the node, then it should work in the meantime.

Solution

I don't know yet, but I'm going to look into database.mysql.inc to see if I can figure out where the problem is occuring. It should just be a matter of inserting the category id into the SQL statement where it is now getting Object. Anyway, I'm new to drupal, but I'll follow up on this if I find a fix.

OpenChimp’s picture

Like I said, I'm new to drupal and I've run into a bit of a hurdle on this.

The functions that handle inserting the term_node records seem to be in this file:
category/wrappers/taxonomy.module.copyme
Here are the instances of the Insert commands:
<%
category/wrappers/taxonomy.module.copyme:543:
db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $typed_term_tid);
category/wrappers/taxonomy.module.copyme:550:
db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $tid, $nid);
category/wrappers/taxonomy.module.copyme:560:
db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, tid);
category/wrappers/taxonomy.module.copyme:565:
db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $term->tid);
category/wrappers/taxonomy.module.copyme:568:
db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $term);
category/wrappers/taxonomy.module.copyme:587:
db_query('DELETE FROM {term_node} WHERE nid = %d', $nid);
%>

My problem two fold.

First of all, I was trying to do debugging by printing values to the screen like print_r($terms); but nothing would display, so I assume this function is called at a time when printing to the screen is not possible. Is that right???

Is there a better way to do debugging that I should know about?

Secondly, I'm not clear on the values here. Here's an example of one of the insert commands:db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $tid);
I don't know what %d is. Where do these values get set?

I just tried installing the latest release of the category module with no change.

If anyone can advise me, I'd love to fix this problem.

bdragon’s picture

%d is a printf-style format specifier meaning "numeric value"

In your example
db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $tid);

the query has two variables. The first is filled with whatever $nid is, the second with whatever $tid is. ($nid represents the node id, and $tid represents the term id.)

Just think "printf" here. http://api.drupal.org/api/4.7/function/db_query has more info.

Also, here's a nice way to debug stuff when you can't print to the screen:
watchdog("DEBUG",var_export($the_variable,TRUE));

That will make an entry in the watchdog log (the one at the root of the administration interface.)
http://api.drupal.org/api/4.7/function/watchdog

JirkaRybka’s picture

Status: Active » Closed (fixed)

This is 4.7.x (now unsupported) and over 2 years of silence, plus a duplicate of #117172: Analysis: Forum (5.x fix), so closing this one.