summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-05-14 04:41:54 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-05-14 04:41:54 +0000
commit9b54c79c868cd310ca8c6ea77fbb337c543f9682 (patch)
tree8261c42299f790139f0b538c179b55bf9a3447d7
parent8aa44b55a2b0745e6c0832c1cce3d75b8b3e64da (diff)
downloadbrdo-9b54c79c868cd310ca8c6ea77fbb337c543f9682.tar.gz
brdo-9b54c79c868cd310ca8c6ea77fbb337c543f9682.tar.bz2
#764726 by catch: Fixed hook_taxonomy_term_presave() is missing.
-rw-r--r--modules/taxonomy/taxonomy.api.php13
-rw-r--r--modules/taxonomy/taxonomy.module1
2 files changed, 14 insertions, 0 deletions
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
@@ -95,6 +95,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.
*
* Modules implementing this hook can act on the term object when saved to
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);