Actually using 6.x-1, not rc3, but it wasn't on the list

I am versioning a feature that requires a particular taxonomy vocabulary I have created. The vocab was left empty when included in the feature. Now, I am having some odd issues where features is getting very confused by changes to the taxonomy. When I added a term to the vocab, the Feature showed Taxonomy as overridden (rightly so). But when I checked the box and clicked the "Revert Components" button, it created a duplicate vocab. Then, I went in and deleted the vocabs, and reverted again to have it start a fresh one. Now, when I go to Recreate the feature, Taxonomy no longer appears on the Edit Components dropdown, so it can't be included. I fiddled around some more just repeating steps (deleting, reverting) then it reappeared and let me recreate.

Comments

mpotter’s picture

Status: Active » Closed (won't fix)

Closing this for lack of activity. Please re-open this issue if you can reproduce it in the latest version.

basvredeling’s picture

Version: 6.x-1.0-rc3 » 6.x-1.x-dev
Status: Closed (won't fix) » Active

In the latest version of the 6.x branch this is still an issue, both in 1.2 and 1.x-dev. I'm at a loss for a solution really.
Reverting the feature with the exported vocabulary just keeps recreating a new vocabulary.
Circumstances in this case:

  1. I've upgraded from some previous versions of the features module
  2. Taxonomy is not linked to a content type
  3. In the database I can see most other module names that have exported vocabularies are prefixed by features_ (ie features_MODULENAME)
  4. Install profile is open atrium

I'm inclined to think it's related to point 3. Cause if you rebuild the feature the code says:

if ($vid = db_result(db_query("SELECT vid FROM {vocabulary} WHERE module = '%s'", 'features_' . $machine_name))) {

--- edit

I've managed to work around this by

  1. backing up the vocabulary terms in the database table "term_data"
  2. deleting the faulty taxonomy
  3. fixing the module name in the hook_taxonomy_default_vocabularies(): features_MODULENAME
  4. matching the vocabulary name to the module name in hook_taxonomy_default_vocabularies(): MODULENAME
  5. let the module recreate the vocabulary
  6. manually reimport the "term_data" table and renumber the terms to the new vocabulary id

this is all terribly sloppy and needs a fix.

the new hook_taxonomy_default_vocabularies() should look something like this:

/**
 * Implementation of hook_taxonomy_default_vocabularies().
 */
function MYMODULE_taxonomy_default_vocabularies() {
  return array(
    'MYMODULE_vocabulary_machine_name' => array(
      'name' => 'Vocabulary name',
      'description' => 'Vocabulary description',
      'help' => 'Vocabulary help.',
      'relations' => '1',
      'hierarchy' => '0',
      'multiple' => '0',
      'required' => '0',
      'tags' => '1',
      'module' => 'features_MYMODULE_vocabulary_machine_name',
      'weight' => '0',
      'nodes' => array(),
    ),
  );
}