diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-29 00:05:03 -0800 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-29 00:05:03 -0800 |
commit | 559c4d739a50a897f0b8dfaf870524694109b6a1 (patch) | |
tree | e9360dc02e5b60feb2a6265a518247f533f2df14 /modules/forum | |
parent | 94677b85b695807b6809c5504af6737ca92903dd (diff) | |
download | brdo-559c4d739a50a897f0b8dfaf870524694109b6a1.tar.gz brdo-559c4d739a50a897f0b8dfaf870524694109b6a1.tar.bz2 |
Issue #1401496 by bleen18, Albert Volkman: Fixed forum_taxonomy_term_delete() completely broken (takes instead of entity).
Diffstat (limited to 'modules/forum')
-rw-r--r-- | modules/forum/forum.module | 4 | ||||
-rw-r--r-- | modules/forum/forum.test | 7 |
2 files changed, 8 insertions, 3 deletions
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.'); } /** |