I have enabled the features and exportables modules. When I go to admin/content/taxonomy/add/vocabulary I get the folowing error:

Fatal error: Cannot redeclare taxonomy_features_api() (previously declared in /.../modules/exportables/modules/taxonomy.inc:52) in /.../modules/features/includes/features.taxonomy.inc on line 16

Comments

dagmar’s picture

Status: Active » Fixed

You are probably using exportables 1.x, exportables/modules/taxonomy.inc file is not included in 2.x branch.

Please check this and be sure you are using Exportables-2.x-beta1.

osopolar’s picture

Yes, accidentally I downloaded 1.x-dev.

[edit]
this happened because I was using drush to download the module without specifying a version

drush dl exportables
Project exportables (6.x-1.x-dev) downloaded to ...
hefox’s picture

How to upgrade production systems from exportables 1.x to new features.

Remove taxonomy_features_api function from exportables 1.x

Add an update hook somewhere that does

  db_query("UPDATE {vocabulary}, {exportables_machine_names} set module = concat('features_', machine) where vid = id and type = 'taxonomy_vocabulary'");

Then if no longer using exportables, disable/uninstall away.

This is my full update function. Was getting duplicate vocabularies due cache clear before updatedb :/.

/**
 * Remove exportables
 */
function mymodule_update_6104() {
  $ret = array();
  // Update for remopving exportables
  db_query("UPDATE {vocabulary}, {exportables_machine_names} set module = concat('features_', machine) where vid = id and type = 'taxonomy_vocabulary'");
  // Remove duplicate vocabularies
  $result = db_query("SELECT vid, module from {vocabulary}");
  $seen = array();
  while ($row = db_fetch_object($result)) {
    if (strpos($row->module, 'features_') === 0) {
      if (empty($seen[$row->module])) {
        $seen[$row->module] = 1;
      }
      else {
        taxonomy_del_vocabulary($row->vid);
      }
    }
  }
  if (db_table_exists('exportables_machine_names')) {
    db_drop_table($ret, 'exportables_machine_names');
  }
  if (db_table_exists('exportables_object_cache')) {
    db_drop_table($ret, 'exportables_object_cache');
  }
  db_query("DELETE from {system} where name = 'exportables'");
  return $ret;
}

Now, for features with exported vocabulary, add
features[taxonomy][] = features_
To the features info file and drush fu the file (or go and recreate the feature, adding the vocabularies).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kenorb’s picture

Marked as duplicate: #1038284: Fatal error: Cannot redeclare taxonomy_features_api()

Solution:
Please remove exportables module and download 6.x-2.x again.
Or please remove at least modules/taxonomy.inc file which is not part of 6.x-2.x
See:
http://drupalcode.org/project/exportables.git/tree/refs/heads/6.x-2.x