Commit a50eb34b authored by Dries's avatar Dries

- Patch #44381 by gerhard: improved consistency of API. Always pass an array.

parent 8b5175a9
...@@ -169,7 +169,7 @@ function taxonomy_save_vocabulary(&$edit) { ...@@ -169,7 +169,7 @@ function taxonomy_save_vocabulary(&$edit) {
} }
function taxonomy_del_vocabulary($vid) { function taxonomy_del_vocabulary($vid) {
$vocabulary = taxonomy_get_vocabulary($vid); $vocabulary = (array) taxonomy_get_vocabulary($vid);
db_query('DELETE FROM {vocabulary} WHERE vid = %d', $vid); db_query('DELETE FROM {vocabulary} WHERE vid = %d', $vid);
db_query('DELETE FROM {vocabulary_node_types} WHERE vid = %d', $vid); db_query('DELETE FROM {vocabulary_node_types} WHERE vid = %d', $vid);
...@@ -331,7 +331,7 @@ function taxonomy_del_term($tid) { ...@@ -331,7 +331,7 @@ function taxonomy_del_term($tid) {
} }
} }
$term = taxonomy_get_term($tid); $term = (array) taxonomy_get_term($tid);
db_query('DELETE FROM {term_data} WHERE tid = %d', $tid); db_query('DELETE FROM {term_data} WHERE tid = %d', $tid);
db_query('DELETE FROM {term_hierarchy} WHERE tid = %d', $tid); db_query('DELETE FROM {term_hierarchy} WHERE tid = %d', $tid);
...@@ -340,7 +340,7 @@ function taxonomy_del_term($tid) { ...@@ -340,7 +340,7 @@ function taxonomy_del_term($tid) {
db_query('DELETE FROM {term_node} WHERE tid = %d', $tid); db_query('DELETE FROM {term_node} WHERE tid = %d', $tid);
module_invoke_all('taxonomy', 'delete', 'term', $term); module_invoke_all('taxonomy', 'delete', 'term', $term);
drupal_set_message(t('Deleted term %name.', array('%name' => theme('placeholder', $term->name)))); drupal_set_message(t('Deleted term %name.', array('%name' => theme('placeholder', $term['name']))));
} }
$tids = $orphans; $tids = $orphans;
......
...@@ -169,7 +169,7 @@ function taxonomy_save_vocabulary(&$edit) { ...@@ -169,7 +169,7 @@ function taxonomy_save_vocabulary(&$edit) {
} }
function taxonomy_del_vocabulary($vid) { function taxonomy_del_vocabulary($vid) {
$vocabulary = taxonomy_get_vocabulary($vid); $vocabulary = (array) taxonomy_get_vocabulary($vid);
db_query('DELETE FROM {vocabulary} WHERE vid = %d', $vid); db_query('DELETE FROM {vocabulary} WHERE vid = %d', $vid);
db_query('DELETE FROM {vocabulary_node_types} WHERE vid = %d', $vid); db_query('DELETE FROM {vocabulary_node_types} WHERE vid = %d', $vid);
...@@ -331,7 +331,7 @@ function taxonomy_del_term($tid) { ...@@ -331,7 +331,7 @@ function taxonomy_del_term($tid) {
} }
} }
$term = taxonomy_get_term($tid); $term = (array) taxonomy_get_term($tid);
db_query('DELETE FROM {term_data} WHERE tid = %d', $tid); db_query('DELETE FROM {term_data} WHERE tid = %d', $tid);
db_query('DELETE FROM {term_hierarchy} WHERE tid = %d', $tid); db_query('DELETE FROM {term_hierarchy} WHERE tid = %d', $tid);
...@@ -340,7 +340,7 @@ function taxonomy_del_term($tid) { ...@@ -340,7 +340,7 @@ function taxonomy_del_term($tid) {
db_query('DELETE FROM {term_node} WHERE tid = %d', $tid); db_query('DELETE FROM {term_node} WHERE tid = %d', $tid);
module_invoke_all('taxonomy', 'delete', 'term', $term); module_invoke_all('taxonomy', 'delete', 'term', $term);
drupal_set_message(t('Deleted term %name.', array('%name' => theme('placeholder', $term->name)))); drupal_set_message(t('Deleted term %name.', array('%name' => theme('placeholder', $term['name']))));
} }
$tids = $orphans; $tids = $orphans;
......
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