[drupal-devel] Folksonomy: No taxonomy.module Changes / URL Design

Morbus Iff morbus at disobey.com
Thu Mar 10 20:36:07 UTC 2005

> This morning, I took a look at all the places in taxonomy.module that 
> used term_node, so as to properly handle the new database addition 
> above. At first glance, I don't see /any/ place that requires changing:

In chatting with killes on IRC, there is one place. Everytime a node
with taxo is saved, all term_node data for that nid is deleted:

   db_query('DELETE FROM {term_node} WHERE nid = %d', $nid);

This would also obliterate all of the folksonomy data (which wouldn't be 
in a taxonomy input field, and thus nothing ever passed in as $terms to 
taxonomy_node_save()). It would be entirely possible to do a dirty ugly 
evil hack and name the module zzz_folksonomy_shared, but god, strike me 
down for even suggesting the idea.

The quick and immediate fix is:

   db_query('DELETE FROM {term_node} WHERE nid = %d AND uid = 0', $nid);

Since a normal taxonomy would receive all relations as uid 0, and a 
folksonomy would save proper folksonomy tags with the proper uid, the 
above would work.

But, I'm now fighting back and forth mentally about how I should move 
forward with this. One of my design decisions was "as tightly bound to 
taxonomy as possible." The above would be a required patch to core. 
Besides the previous SQL change, the minisculeness of the above change 
visually lessens its importance. It's easy to forget the reasonings WHY it 
is necessary, especially since it'd be the only uid mention in the entire 
taxonomy module.

On the other hand, I could lose my tightnening, and reproduce term_node as 
folksonomy_term_node. Unfortunately, that'd mean I'd have to reproduce a 
lot of taxonomy retrieval code in the folksonomy_shared module.

I'm not sure which direction to go here.

Morbus Iff ( you are nothing without your robot car, NOTHING! )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Spidering Hacks: http://amazon.com/exec/obidos/ASIN/0596005776/disobeycom
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus

More information about the drupal-devel mailing list