diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-20 07:47:55 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-20 07:47:55 +0000 |
commit | 07ef159518b88245f3f1aa5635784ee7745d619e (patch) | |
tree | 8871ff29a7ae606593fe3bc2a8cf6d9f193c71e5 | |
parent | 100ea2d1859bdbd5ef29d5699c7e6ead8c113c78 (diff) | |
download | brdo-07ef159518b88245f3f1aa5635784ee7745d619e.tar.gz brdo-07ef159518b88245f3f1aa5635784ee7745d619e.tar.bz2 |
#773824 by scor: Fixed taxonomy_update_7002() fails when more than one vocabulary to upgrade.
-rw-r--r-- | modules/taxonomy/taxonomy.install | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/taxonomy/taxonomy.install b/modules/taxonomy/taxonomy.install index c16bdf1a2..cdbafd5e3 100644 --- a/modules/taxonomy/taxonomy.install +++ b/modules/taxonomy/taxonomy.install @@ -259,16 +259,19 @@ function taxonomy_update_7002() { ); db_add_field('taxonomy_vocabulary', 'machine_name', $field); - db_add_unique_key('taxonomy_vocabulary', 'machine_name', array('machine_name')); foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) { $machine_name = 'vocabulary_' . $vid; db_update('taxonomy_vocabulary') - ->fields(array('machine_name' => 'vocabulary_' . $vid)) + ->fields(array('machine_name' => $machine_name)) ->condition('vid', $vid) ->execute(); field_attach_create_bundle('taxonomy_term', $machine_name); } + + // The machine_name unique key can only be added after we ensure the + // machine_name column contains unique values. + db_add_unique_key('taxonomy_vocabulary', 'machine_name', array('machine_name')); } /** |