Add function for modules to register and name a vocabulary

robertDouglass - February 9, 2006 - 02:05
Project:Drupal
Version:7.x-dev
Component:taxonomy.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

I often write modules that depend on a specific vocabulary for some integral part of the module's behavior. This always precipitates the need to map the vocabulary to the module, usually in the module's settings. OR, some modules create the vocabulary from scratch. Both of these could be automated if the taxonomy module had a function that modules could call to create and register a vocabulary with a module. This would also presumably give modules a way to query which vocabulary they were mapped to for a specific purpose.

#1

mfredrickson - February 14, 2006 - 20:53
Status:active» needs review

This feature is 1/2 there already. Vocabs can be owned by a module, but taxonomy doesn't respect that ownership.

Attached is a patch that makes taxonomy play nice with other modules by not including their vocabularies in the overall list on every node.

Frankly, I don't love this solution, but I can't find a way to invoke hook_form_alter on the "categories" subsection of the node_edit form. Additionally, I can't guarantee that my module will run after taxonomy, and thus have access to the changes made in taxonomy_form_alter.

By forcing taxonomy to play nice, at least we get some ability to stop it from displaying our categories.

I think a logical extension on this patch would be to include which module controls a taxonomy in the 'admin/categories' screen. This would allow people the knowledge that they shouldn't mess with other modules' categories by directly messing with them in the 'admin/categories'

-M

AttachmentSize
taxonomy.respect.patch.20060214 547 bytes

#2

mfredrickson - February 14, 2006 - 20:54

Oh and if I wasn't clear before, the ownership is controlled by the 'module' field in the vocabulary table.

#3

benshell - March 14, 2006 - 19:36

Any progress on this? Just curious, as I could use something like this on a module I'm working on.

#4

mfredrickson - March 16, 2006 - 06:04

This will happen in core after 4.7.

Dries has designated taxonomy as one of several key areas of focus for 4.8.

In the meantime I'm working half heartedly on a module to provide some useful taxonomy helper functions (along with a patch to taxonomy.module to add some more hooks). Lately, I've been questioning whether or not this is a worthwhile task.

I'm waiting until that effort gets underway before doing much more.

-M

#5

Jaza - January 30, 2007 - 03:37
Version:x.y.z» 6.x-dev
Status:needs review» needs work

I don't think that hiding non-taxonomy-owned vocabs completely is the right solution. A better alternative would be to move them to a separate table, or to a separate tab.

Moving to 6.x.

#6

catch - October 30, 2007 - 11:24
Version:6.x-dev» 7.x-dev

bumping this to D7.

#7

Robin Monks - September 1, 2008 - 18:08

Is this still needed?

 
 

Drupal is a registered trademark of Dries Buytaert.