From 559c4d739a50a897f0b8dfaf870524694109b6a1 Mon Sep 17 00:00:00 2001 From: webchick Date: Wed, 29 Feb 2012 00:05:03 -0800 Subject: Issue #1401496 by bleen18, Albert Volkman: Fixed forum_taxonomy_term_delete() completely broken (takes instead of entity). --- modules/forum/forum.module | 4 ++-- modules/forum/forum.test | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'modules/forum') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index d35fe5626..472efd1f7 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -468,10 +468,10 @@ function forum_permission() { /** * Implements hook_taxonomy_term_delete(). */ -function forum_taxonomy_term_delete($tid) { +function forum_taxonomy_term_delete($term) { // For containers, remove the tid from the forum_containers variable. $containers = variable_get('forum_containers', array()); - $key = array_search($tid, $containers); + $key = array_search($term->tid, $containers); if ($key !== FALSE) { unset($containers[$key]); } diff --git a/modules/forum/forum.test b/modules/forum/forum.test index c7c3d9c1b..663b8725f 100644 --- a/modules/forum/forum.test +++ b/modules/forum/forum.test @@ -242,7 +242,7 @@ class ForumTestCase extends DrupalWebTestCase { // Save forum overview. $this->drupalPost('admin/structure/forum/', array(), t('Save')); $this->assertRaw(t('The configuration options have been saved.')); - // Delete this second form. + // Delete this second forum. $this->deleteForum($this->delete_forum['tid']); // Create forum at the top (root) level. $this->root_forum = $this->createForum('forum'); @@ -341,6 +341,11 @@ class ForumTestCase extends DrupalWebTestCase { // Assert that the forum no longer exists. $this->drupalGet('forum/' . $tid); $this->assertResponse(404, 'The forum was not found'); + + // Assert that the associated term has been removed from the + // forum_containers variable. + $containers = variable_get('forum_containers', array()); + $this->assertFalse(in_array($tid, $containers), 'The forum_containers variable has been updated.'); } /** -- cgit v1.2.3