diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2011-08-29 23:12:18 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2011-08-29 23:12:18 -0700 |
commit | 16b5120350eccb2f40c1eea6b2a854bdf9dc87bb (patch) | |
tree | 0b5529208bc57030887b111fd996a6c04acf91eb /modules/forum | |
parent | b9f87d85b5e9e8544b81d26ab17859a28ef64d17 (diff) | |
download | brdo-16b5120350eccb2f40c1eea6b2a854bdf9dc87bb.tar.gz brdo-16b5120350eccb2f40c1eea6b2a854bdf9dc87bb.tar.bz2 |
Issue #943772 by jpsoto, yched, catch, bojanz, pillarsdotnet, steinmb: Fixed field_delete_field() and others fail for inactive fields.
Diffstat (limited to 'modules/forum')
-rw-r--r-- | modules/forum/forum.install | 5 | ||||
-rw-r--r-- | modules/forum/forum.test | 25 |
2 files changed, 30 insertions, 0 deletions
diff --git a/modules/forum/forum.install b/modules/forum/forum.install index 60c408793..1bed2e34c 100644 --- a/modules/forum/forum.install +++ b/modules/forum/forum.install @@ -113,6 +113,11 @@ function forum_uninstall() { variable_del('forum_block_num_active'); variable_del('forum_block_num_new'); variable_del('node_options_forum'); + + field_delete_field('taxonomy_forums'); + // Purge field data now to allow taxonomy module to be uninstalled + // if this is the only field remaining. + field_purge_batch(10); } /** diff --git a/modules/forum/forum.test b/modules/forum/forum.test index 1dc45c6fd..c7c3d9c1b 100644 --- a/modules/forum/forum.test +++ b/modules/forum/forum.test @@ -31,6 +31,7 @@ class ForumTestCase extends DrupalWebTestCase { // Create users. $this->admin_user = $this->drupalCreateUser(array( 'access administration pages', + 'administer modules', 'administer blocks', 'administer forums', 'administer menu', @@ -52,6 +53,30 @@ class ForumTestCase extends DrupalWebTestCase { } /** + * Tests disabling and re-enabling forum. + */ + function testEnableForumField() { + $this->drupalLogin($this->admin_user); + + // Disable the forum module. + $edit = array(); + $edit['modules[Core][forum][enable]'] = FALSE; + $this->drupalPost('admin/modules', $edit, t('Save configuration')); + $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.')); + module_list(TRUE); + $this->assertFalse(module_exists('forum'), t('Forum module is not enabled.')); + + // Attempt to re-enable the forum module and ensure it does not try to + // recreate the taxonomy_forums field. + $edit = array(); + $edit['modules[Core][forum][enable]'] = 'forum'; + $this->drupalPost('admin/modules', $edit, t('Save configuration')); + $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.')); + module_list(TRUE); + $this->assertTrue(module_exists('forum'), t('Forum module is enabled.')); + } + + /** * Login users, create forum nodes, and test forum functionality through the admin and user interfaces. */ function testForum() { |