This project is not covered by Drupal’s security advisory policy.

This module's audience is developers who require machine names for taxonomy vocabularies, including views support. This module allows existing (and new) installations to continue using the Drupal 6 taxonomy API while gaining the benefits of vocabulary machine names.

As such, it should play nice with any taxonomy related modules (such as those that provide import / export features, etc...)

Background

Taxonomies are a bit of an issue to deal with in Drupal, specifically in terms of using them in install profile or update hooks, team development, and deployment through environments.

There are a few modules out there which try to get around this issue. However, they are limited in a number of ways. Currently there are 3 methods I can see in trying to solve this. This module goes with #3.

  1. Use existing modules (such as features_extras or exportables). This provides taxonomy (among other) machine name support, however, it can require multi-module dependencies, and typically require additional calls while programming. As well, there is typically no views support to remove "vid"s from view exports.
  2. Roll your own. Without touching core, this is rather tricky, due to the lack of a view operation in the hook_taxonomy() call. Basically, we cannot attach data (elegantly) to a taxonomy_get_*() call, without creating piles of functions to replicate existing functionality.
  3. "Patch" the core vocabulary table by adding a machine_name field. This solves a lot of issues, as all the standard CRUD operations assume v.* (when retrieving) or use drupal_get_schema() to introspect fields while inserting / updating. In addition, this makes exposure of the Vocabulary: Machine name views handlers quite trivial.

New Fun Stuff

When installed, this module provides the following features

  • Will generate a machine name based on the vocabulary name upon install.
  • Adds a new function "taxonomy_get_vocabulary()" which takes a machine_name. Additionally, optionally takes a second option (boolean) which indicates whether to mirror the return of "taxonomy_get_tree()".
  • By "default" any of the "taxonomy_get_*()" functions should return the machine_name field now, which should theoretically help in conflicts due to random serial IDs. As well, you can programmatically build taxonomies with machine names, which should make initial install profile setups easier.
  • A number of views handlers, that allow the use of vocabulary machine names as arguments and filters. As well, a field handler that allows access to the vocabularies term's restricted by machine name.

More Machine Name Fun

Hopefully, the future of Drupal will be in exportables or similar. This module serves as a stopgap until some sort of exportables like framework is within Drupal. The machine name revolution is mainly a result of talks at DrupalCon SF2010 surrounding deployment issues. Take a look at this post to see how machine names fit within the overall deployment effort underway.

Project information

Releases