Adding fields to Taxonomy?

SteveTurnbull - April 21, 2008 - 10:18
Project:Category
Version:5.x-1.1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I asked this in the general forum (http://drupal.org/node/249065) but thought it's be better here...

Bit of background: There are some sophisticated taxonomy systems out in the real world, I want to set up a system to import and maintain one of these. As a result the ability to (for example) enable and disable a particualr taxonomy term, and also store some additional data for each term would be very useful.

I'm no newbie so have no problem creating a new table to store this extra information, nor adding stuff to forms and saving new data because hook_taxonomy provides interception of insert, update and delete.

But hook_taxonomy doesn't provide interception of 'load'. Which is very annoying. I can't even use db_rewrite_sql because you can't add to the fields that get loaded.

The only solution I can think of is intercepting hook_nodeapi and check the node's taxonomy and add the data there, but that seems a bit late in the day.

Is there a better solution? How hard would it be to patch? (I can't think it would be very hard I've checked the code and there's only a couple of locations that need it.)

Steve

#1

PGiro - April 28, 2008 - 11:05

I think I've posted something similar here : http://drupal.org/node/251119

#2

kehan - April 28, 2008 - 14:01

subscribing

#3

SteveTurnbull - April 30, 2008 - 12:08

I posted "solutions", 4 of them, here http://drupal.org/node/249065

None of them are good, I have chosen what's behind door (d).

Steve

 
 

Drupal is a registered trademark of Dries Buytaert.