summaryrefslogtreecommitdiff
path: root/modules/taxonomy
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-11-10 19:40:23 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-11-10 19:40:23 +0000
commit4476a2c0156451fb13e3dd2d9308e6c694caa378 (patch)
treeec3aa61687d13eec266505740f2135e56902f04e /modules/taxonomy
parent6263c0f22c4b97f99be66c97ba1bae6431eaa2a5 (diff)
downloadbrdo-4476a2c0156451fb13e3dd2d9308e6c694caa378.tar.gz
brdo-4476a2c0156451fb13e3dd2d9308e6c694caa378.tar.bz2
#83202 by Jaza. Separate out node type deletion API and use it to keep {vocabulary_node_types} updated.
Diffstat (limited to 'modules/taxonomy')
-rw-r--r--modules/taxonomy/taxonomy.module14
1 files changed, 4 insertions, 10 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 40fde59c7..b38bde579 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -818,16 +818,10 @@ function taxonomy_node_delete($nid) {
*/
function taxonomy_node_type($op, $info) {
if ($op == 'update' && !empty($info->old_type) && $info->type != $info->old_type) {
- if (db_num_rows(db_query("SELECT * from {vocabulary_node_types} WHERE type = '%s'", $info->old_type))) {
- db_query("UPDATE {vocabulary_node_types} SET type = '%s' WHERE type = '%s'", $info->type, $info->old_type);
- $num_updated = db_affected_rows();
-
- if ($num_updated) {
- $substr_pre = 'Changed the content type association of ';
- $substr_post = strtr(' from %old-type to %type.', array('%old-type' => theme('placeholder', $info->old_type), '%type' => theme('placeholder', $info->type)));
- drupal_set_message(format_plural($num_updated, $substr_pre .'1 vocabulary'. $substr_post, $substr_pre .'@count vocabularies'. $substr_post));
- }
- }
+ db_query("UPDATE {vocabulary_node_types} SET type = '%s' WHERE type = '%s'", $info->type, $info->old_type);
+ }
+ elseif ($op == 'delete') {
+ db_query("DELETE FROM {vocabulary_node_types} WHERE type = '%s'", $info->type);
}
}