summaryrefslogtreecommitdiff
path: root/modules/forum
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-01-28 01:09:58 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-01-28 01:09:58 +0000
commit585aa50e6a2d7d8f67f8116c207a342c47728dfb (patch)
treeea090bf3b003a314237e5cef4d94124bcaa42a46 /modules/forum
parentf5a4f24b5e02c82f67d90116356f83a542f5b99f (diff)
downloadbrdo-585aa50e6a2d7d8f67f8116c207a342c47728dfb.tar.gz
brdo-585aa50e6a2d7d8f67f8116c207a342c47728dfb.tar.bz2
#346156 by stBorchert, swentel, and catch: Fix deletion of terms (with tests).
Diffstat (limited to 'modules/forum')
-rw-r--r--modules/forum/forum.admin.inc2
-rw-r--r--modules/forum/forum.test19
2 files changed, 20 insertions, 1 deletions
diff --git a/modules/forum/forum.admin.inc b/modules/forum/forum.admin.inc
index ce1618fca..c758ef442 100644
--- a/modules/forum/forum.admin.inc
+++ b/modules/forum/forum.admin.inc
@@ -173,7 +173,7 @@ function forum_confirm_delete(&$form_state, $tid) {
* Implementation of forms api _submit call. Deletes a forum after confirmation.
*/
function forum_confirm_delete_submit($form, &$form_state) {
- taxonomy_del_term($form_state['values']['tid']);
+ taxonomy_term_delete($form_state['values']['tid']);
drupal_set_message(t('The forum %term and all sub-forums have been deleted.', array('%term' => $form_state['values']['name'])));
watchdog('content', 'forum: deleted %term and all its sub-forums.', array('%term' => $form_state['values']['name']));
diff --git a/modules/forum/forum.test b/modules/forum/forum.test
index b8e9136c0..95f0ccbfe 100644
--- a/modules/forum/forum.test
+++ b/modules/forum/forum.test
@@ -103,6 +103,10 @@ class ForumTestCase extends DrupalWebTestCase {
$this->container = $this->createForum('container');
// Create forum inside the forum container.
$this->forum = $this->createForum('forum', $this->container['tid']);
+ // Create second forum in container.
+ $this->delete_forum = $this->createForum('forum', $this->container['tid']);
+ // Delete this second form.
+ $this->deleteForum($this->delete_forum['tid']);
// Create forum at the top (root) level.
$this->root_forum = $this->createForum('forum');
}
@@ -182,6 +186,21 @@ class ForumTestCase extends DrupalWebTestCase {
}
/**
+ * Delete a forum.
+ *
+ * @param integer $tid Forum id.
+ */
+ function deleteForum($tid) {
+ // Delete the forum id.
+ $this->drupalPost('admin/build/forum/edit/forum/'. $tid, array(), t('Delete'));
+ $this->drupalPost(NULL, NULL, t('Delete'));
+
+ // Assert that the forum no longer exists.
+ $this->drupalGet('forum/'. $tid);
+ $this->assertRaw(t('No forums defined'), 'The forum was not found');
+ }
+
+ /**
* Run basic tests on the indicated user.
*
* @param object $user The logged in user.