Commit 0e68871d authored by webchick's avatar webchick
Browse files

#835046 by mikeytown2: Fixed hook_taxonomy_vocabulary_presave() is missing.

parent 0a5d9dd3
......@@ -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.
*
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment