From 9b54c79c868cd310ca8c6ea77fbb337c543f9682 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Fri, 14 May 2010 04:41:54 +0000 Subject: #764726 by catch: Fixed hook_taxonomy_term_presave() is missing. --- modules/taxonomy/taxonomy.api.php | 13 +++++++++++++ modules/taxonomy/taxonomy.module | 1 + 2 files changed, 14 insertions(+) diff --git a/modules/taxonomy/taxonomy.api.php b/modules/taxonomy/taxonomy.api.php index 31aa2de52..c66ccdfb1 100644 --- a/modules/taxonomy/taxonomy.api.php +++ b/modules/taxonomy/taxonomy.api.php @@ -94,6 +94,19 @@ function hook_taxonomy_term_load($terms) { } } +/** + * Act on taxonomy terms before they are saved. + * + * Modules implementing this hook can act on the term object before it is + * inserted or updated. + * + * @param $term + * A term object. + */ +function hook_taxonomy_term_presave($term) { + $term->foo = 'bar'; +} + /** * Act on taxonomy terms when inserted. * diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index b61a83dd1..5a184c337 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -469,6 +469,7 @@ function taxonomy_term_save($term) { } field_attach_presave('taxonomy_term', $term); + module_invoke_all('taxonomy_term_presave', $term); if (empty($term->tid)) { $status = drupal_write_record('taxonomy_term_data', $term); -- cgit v1.2.3