[drupal-devel] forum table WTF

Gabor Hojtsy gabor at hojtsy.hu
Mon Jun 6 14:11:11 UTC 2005

>>It seems that the nid->tid relationship is maintained, loaded, inserted,
>>updated, removed, but then only used in the forum_get_topics query and
>>only to ensure (on top of term_node) that the nids match. If this is
>>connected to the shadow copy feature, then this query is supposed to
>>select the 'primary term' for this particular node, and this is why the
>>whole maintanance stuff is needed. From the implementation of the shadow
>>copy feature, it stores all the relations in the term_node table, and
>>maintains no information on what is the primary term for a forum node.
> IIRC, the "shadow copy" feature was simplified to not have a "primary
> tid" anymore about a year ago.

Well, it does not seem so. The query I posted from forum_get_topics() is
from latest Drupal CVS (forum module 1.256), and it only selects topics
(nodes) registered in the forum table. And since the forum table has a
nid primary key.. TADA, we found the "primary tid".

Here is the important part:

SELECT n.nid, f.tid ... FROM {node} n, ... {forum} f WHERE n.nid = f.nid


More information about the drupal-devel mailing list