I think there's a problem with Features in that if you have a feature that is a dependency of an install profile (designated the primary install profile), and that primary profile in turn invokes another install profile (in our case it invokes the standard profile installation), and that feature has field bases/taxonomies that were created by the standard install profile, then the build process explodes when attempting to install the primary profile like so:

WD php: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'tags' for key 'machine_name': INSERT INTO          [error]
{taxonomy_vocabulary} (name, machine_name, description, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1,
:db_insert_placeholder_2, :db_insert_placeholder_3); Array
(
    [:db_insert_placeholder_0] => Tags
    [:db_insert_placeholder_1] => tags
    [:db_insert_placeholder_2] => Use tags to group articles on similar topics into categories.
    [:db_insert_placeholder_3] => taxonomy
)
 in drupal_write_record() (line 7194 of /drupal/includes/common.inc).
Cannot modify header information - headers already sent by (output started at /usr/local/Cellar/drush/HEAD/libexec/includes/output.inc:38)      [warning]
bootstrap.inc:1217
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'tags' for key 'machine_name': INSERT INTO {taxonomy_vocabulary} (name, machine_name, description, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array
(
    [:db_insert_placeholder_0] => Tags
    [:db_insert_placeholder_1] => tags
    [:db_insert_placeholder_2] => Use tags to group articles on similar topics into categories.
    [:db_insert_placeholder_3] => taxonomy
)
 in drupal_write_record() (line 7194 of /drupal/includes/common.inc).
Drush command terminated abnormally due to an unrecoverable error.

Steps to replicate:

1) Create a feature that includes field bases or taxonomies defined by the standard install profile. An example would be to include field base field_tags and also the tags taxonomy.

2) Download the feature. Add this feature as a dependency to a custom install profile.

3) Have the custom install profile invoke the standard install profile in it's install hook, like so:

function my_profile_install() {
  // run the standard install first
  include_once DRUPAL_ROOT . '/profiles/standard/standard.install';
  standard_install();
}

4) Install site using the my_profile install profile.

5) Verify that the installation process errors out, specifically complaining about taxonomy/field bases already existing (if installing using drush si, you'll see the error posted above).

Comments

lpeabody’s picture

Issue summary: View changes
saltednut’s picture

Version: 7.x-2.0 » 7.x-2.x-dev

I've seen this too in the latest HEAD. The workaround is to either use a different profile than standard that does not create the 'Tags' vocabulary or to avoid versioning the 'Tags' vocabulary in a Feature (and possibly including it as an exclude like features_exclude[taxonomy][tags] = tags)

But there are cases where one wants to version things about these vocabularies. For example: maybe you have special permissions for the 'tags' vocabulary that you wish to version. Features will throw a warning when the Feature is enabled that no module creates permissions for the editing or deleting tags. Just an example.

hefox’s picture

cache not being cleared on creating taxonomy?