diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-06-24 22:21:51 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-06-24 22:21:51 +0000 |
commit | 0e68871da85154d9d35c64771361b8f157870a62 (patch) | |
tree | 823459b6add3844aa757f1fd0b643c7a64d91621 | |
parent | 0a5d9dd354c659a3e5992c0acacebe300a4d3654 (diff) | |
download | brdo-0e68871da85154d9d35c64771361b8f157870a62.tar.gz brdo-0e68871da85154d9d35c64771361b8f157870a62.tar.bz2 |
#835046 by mikeytown2: Fixed hook_taxonomy_vocabulary_presave() is missing.
-rw-r--r-- | modules/taxonomy/taxonomy.api.php | 14 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.api.php b/modules/taxonomy/taxonomy.api.php index c66ccdfb1..6ceab8f80 100644 --- a/modules/taxonomy/taxonomy.api.php +++ b/modules/taxonomy/taxonomy.api.php @@ -26,6 +26,20 @@ function hook_taxonomy_vocabulary_load($vocabularies) { } } + +/** + * Act on taxonomy vocabularies before they are saved. + * + * Modules implementing this hook can act on the vocabulary object before it is + * inserted or updated. + * + * @param $vocabulary + * A taxonomy vocabulary object. + */ +function hook_taxonomy_vocabulary_presave($vocabulary) { + $vocabulary->foo = 'bar'; +} + /** * Act on taxonomy vocabularies when inserted. * diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 8d25355f0..a4bb1de84 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -375,6 +375,8 @@ function taxonomy_vocabulary_save($vocabulary) { $vocabulary->module = 'taxonomy'; } + module_invoke_all('taxonomy_vocabulary_presave', $vocabulary); + if (!empty($vocabulary->vid) && !empty($vocabulary->name)) { $status = drupal_write_record('taxonomy_vocabulary', $vocabulary, 'vid'); module_invoke_all('taxonomy_vocabulary_update', $vocabulary); |