From 0e68871da85154d9d35c64771361b8f157870a62 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 24 Jun 2010 22:21:51 +0000 Subject: #835046 by mikeytown2: Fixed hook_taxonomy_vocabulary_presave() is missing. --- modules/taxonomy/taxonomy.api.php | 14 ++++++++++++++ modules/taxonomy/taxonomy.module | 2 ++ 2 files changed, 16 insertions(+) (limited to 'modules') 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); -- cgit v1.2.3