summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-04-06 04:21:12 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-04-06 04:21:12 +0000
commitbe0b774cbcae15a664eff0f308b436aabd6f3dd0 (patch)
treea73a8ba649c4eb4d9db6ffe2b6566c2d9dbdcbc7 /modules
parentec04325bb29f431f05d59a7cb8e4429b86267b65 (diff)
downloadbrdo-be0b774cbcae15a664eff0f308b436aabd6f3dd0.tar.gz
brdo-be0b774cbcae15a664eff0f308b436aabd6f3dd0.tar.bz2
- #57523: Make taxonomy delete vocabulary consistent with other taxonomy hook ops
Diffstat (limited to 'modules')
-rw-r--r--modules/forum.module6
-rw-r--r--modules/forum/forum.module6
-rw-r--r--modules/taxonomy.module8
-rw-r--r--modules/taxonomy/taxonomy.module8
4 files changed, 14 insertions, 14 deletions
diff --git a/modules/forum.module b/modules/forum.module
index cc607d18c..d3f6ea154 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -149,10 +149,10 @@ function forum_nodeapi(&$node, $op, $teaser, $page) {
* Implementation of hook_taxonomy().
*/
function forum_taxonomy($op, $type, $term = NULL) {
- if ($op == 'delete' && $term->vid == _forum_get_vid()) {
+ if ($op == 'delete' && $term['vid'] == _forum_get_vid()) {
switch ($type) {
case 'term':
- $results = db_query('SELECT f.nid FROM {forum} f WHERE f.tid = %d', $term->tid);
+ $results = db_query('SELECT f.nid FROM {forum} f WHERE f.tid = %d', $term['tid']);
while ($node = db_fetch_object($results)) {
// node_delete will also remove any association with non-forum vocabularies.
node_delete($node->nid);
@@ -160,7 +160,7 @@ function forum_taxonomy($op, $type, $term = NULL) {
// For containers, remove the tid from the forum_containers variable.
$containers = variable_get('forum_containers', array());
- if ($key = array_search($term->tid, $containers)) {
+ if ($key = array_search($term['tid'], $containers)) {
unset($containers[$key]);
}
variable_set('forum_containers', $containers);
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index cc607d18c..d3f6ea154 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -149,10 +149,10 @@ function forum_nodeapi(&$node, $op, $teaser, $page) {
* Implementation of hook_taxonomy().
*/
function forum_taxonomy($op, $type, $term = NULL) {
- if ($op == 'delete' && $term->vid == _forum_get_vid()) {
+ if ($op == 'delete' && $term['vid'] == _forum_get_vid()) {
switch ($type) {
case 'term':
- $results = db_query('SELECT f.nid FROM {forum} f WHERE f.tid = %d', $term->tid);
+ $results = db_query('SELECT f.nid FROM {forum} f WHERE f.tid = %d', $term['tid']);
while ($node = db_fetch_object($results)) {
// node_delete will also remove any association with non-forum vocabularies.
node_delete($node->nid);
@@ -160,7 +160,7 @@ function forum_taxonomy($op, $type, $term = NULL) {
// For containers, remove the tid from the forum_containers variable.
$containers = variable_get('forum_containers', array());
- if ($key = array_search($term->tid, $containers)) {
+ if ($key = array_search($term['tid'], $containers)) {
unset($containers[$key]);
}
variable_set('forum_containers', $containers);
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index c4e8c7fd1..69fe701ab 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -121,7 +121,7 @@ function taxonomy_menu($may_cache) {
* List and manage vocabularies.
*/
function taxonomy_overview_vocabularies() {
- $vocabularies = taxonomy_get_vocabularies();
+ $vocabularies = taxonomy_get_vocabularies();
foreach ($vocabularies as $vocabulary) {
$types = array();
foreach ($vocabulary->nodes as $type) {
@@ -133,7 +133,7 @@ function taxonomy_overview_vocabularies() {
$form[$vocabulary->vid]['edit'] = array('#value' => l(t('edit vocabulary'), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"));
$form[$vocabulary->vid]['list'] = array('#value' => l(t('list terms'), "admin/taxonomy/$vocabulary->vid"));
}
-
+
return drupal_get_form('taxonomy_overview_vocabularies', $form);
}
@@ -156,7 +156,7 @@ function theme_taxonomy_overview_vocabularies($form) {
$rows[] = array(array('data' => t('No categories available.'), 'colspan' => '4', 'class' => 'message'));
}
$header = array(t('Name'), t('Type'), array('data' => t('Operations'), 'colspan' => '2'));
-
+
$output = theme('table', $header, $rows, array('id' => 'taxonomy'));
$output .= form_render($form);
return $output;
@@ -509,7 +509,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_hierarchy} WHERE tid = %d', $tid);
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index c4e8c7fd1..69fe701ab 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -121,7 +121,7 @@ function taxonomy_menu($may_cache) {
* List and manage vocabularies.
*/
function taxonomy_overview_vocabularies() {
- $vocabularies = taxonomy_get_vocabularies();
+ $vocabularies = taxonomy_get_vocabularies();
foreach ($vocabularies as $vocabulary) {
$types = array();
foreach ($vocabulary->nodes as $type) {
@@ -133,7 +133,7 @@ function taxonomy_overview_vocabularies() {
$form[$vocabulary->vid]['edit'] = array('#value' => l(t('edit vocabulary'), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"));
$form[$vocabulary->vid]['list'] = array('#value' => l(t('list terms'), "admin/taxonomy/$vocabulary->vid"));
}
-
+
return drupal_get_form('taxonomy_overview_vocabularies', $form);
}
@@ -156,7 +156,7 @@ function theme_taxonomy_overview_vocabularies($form) {
$rows[] = array(array('data' => t('No categories available.'), 'colspan' => '4', 'class' => 'message'));
}
$header = array(t('Name'), t('Type'), array('data' => t('Operations'), 'colspan' => '2'));
-
+
$output = theme('table', $header, $rows, array('id' => 'taxonomy'));
$output .= form_render($form);
return $output;
@@ -509,7 +509,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_hierarchy} WHERE tid = %d', $tid);