Closed (works as designed)
Project:
Drupal core
Version:
6.1
Component:
forum.module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Mar 2008 at 19:09 UTC
Updated:
3 Jan 2009 at 00:33 UTC
I'm confused about the purpose of the {forum} table? In D5, it used to store vids, which {term_node} didn't, but now that {term_node} has vids, too, it seems like {forum} is just a (redundant!) subset of {term_node}.
Does the {forum} table serve any useful purpose? Can it ever contain any rows that are not in {term_node}?
Comments
Comment #1
nevets commentedI suspect the issue is that it is only a subset. Since you can use the forum vocabulary for other content types {term_node} may contain entries for content that are not part of the forum.
Comment #2
salvisFrom the Drupal 6 release announcement:
I understand this to mean that any node (of any content type that supports the Forum vocabulary) that has a term of the Forum vocabulary assigned, is in that forum.
IOW, any {term_node} record with a tid out of the Forum vocabulary would also be in the {forum} table.
Am I missing something?
Comment #3
nevets commentedI took it to mean you can include other content types in the forums but that you could also just use the same vocabulary without putting the content in the forum.
Comment #4
salvisI've created an event (not forum topic) and assigned a forum term, and the event shows up in the forum.
How would you assign a forum term without having the node show up in the forum?
Comment #5
salvisThere's a query in forum_get_topics() that goes like this:
If n.vid = r.vid = f.vid, shouldn't f.tid be the same as r.tid? Why join with the {forum} table?
Comment #6
salvisI got my answer: {forum} has only one (nid/vid/tid) record per vid, namely the one referring to THE forum which contains the node. If a forum topic is moved from tid1 to tid2 and the user chooses to leave a shadow copy behind, then {forum} will have (nid/vid/tid2), and {term_node} will have both (nid/vid/tid1) and (nid/vid/tid2).
In the query above the JOIN with {term_node} and the r.tid = %d condition gives us not just the nodes in %d but also those that have shadows in %d, and the JOIN with {forum} gives us f.tid AS forum_tid, so we know whether we have a forum post or just a shadow.
Comment #7
keith.smith commentedComment #8
akwala commentedsubscribe