Start with a clean D7 HEAD install. Activate forum.module, then immediately deactivate it and uninstall it.

forum.module appears to have uninstalled fine. But then if you go and switch forum.module back on, you get this error message:

FieldException: Attempt to create field name <em>taxonomy_forums</em> which already exists and is active. in field_create_field() (line 255 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/modules/field/field.crud.inc).

And the screen looks like the first attached screenshot.

Go back to the site's root, and it displays fine. Go to admin/config/modules and forum.module is activated. It appears to deactivate fine. But go to uninstall it and you get the following errors:

    *  Notice: Undefined index: machine_name in taxonomy_vocabulary_delete() (line 336 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/modules/taxonomy/taxonomy.module).
    * Notice: Undefined index: field_name in field_delete_instance() (line 861 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/modules/field/field.crud.inc).
    * Notice: Undefined index: object_type in field_delete_instance() (line 862 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/modules/field/field.crud.inc).
    * Notice: Undefined index: bundle in field_delete_instance() (line 863 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/modules/field/field.crud.inc).
    * Notice: Undefined index: field_name in field_delete_instance() (line 867 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/modules/field/field.crud.inc).
    * Notice: Undefined index: field_name in field_delete_instance() (line 861 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/modules/field/field.crud.inc).
    * Notice: Undefined index: object_type in field_delete_instance() (line 862 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/modules/field/field.crud.inc).
    * Notice: Undefined index: bundle in field_delete_instance() (line 863 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/modules/field/field.crud.inc).
    * Notice: Undefined index: field_name in field_delete_instance() (line 867 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/modules/field/field.crud.inc).

For the full screen at this point, see the second attached screenshot.

CommentFileSizeAuthor
#7 update2-619904-forum-module-uninstall-issue.patch1.44 KBAnonymous (not verified)
#5 updated-619904-forum-module-uninstall-issue.patch1.43 KBAnonymous (not verified)
#3 619904-forum-module-uninstall-issue.patch1.43 KBAnonymous (not verified)
Screenshot2.png185.5 KBjim0203
Screenshot1.png84.21 KBjim0203

Comments

brianV’s picture

Priority: Normal » Critical

I got errors while uninstalling forum.moudle as well. ALthough different from those in the initial post:

    *  Notice: Trying to get property of non-object in entity_extract_ids() (line 6333 of /opt/lampp/htdocs/d7/includes/common.inc).
    * Notice: Undefined index: field_name in _field_invoke() (line 194 of /opt/lampp/htdocs/d7/modules/field/field.attach.inc).
    * Notice: Undefined index: field_name in _field_invoke() (line 194 of /opt/lampp/htdocs/d7/modules/field/field.attach.inc).
    * Notice: Undefined index: field_name in _field_invoke() (line 194 of /opt/lampp/htdocs/d7/modules/field/field.attach.inc).
    * Notice: Trying to get property of non-object in entity_extract_ids() (line 6333 of /opt/lampp/htdocs/d7/includes/common.inc).
    * Notice: Undefined index: field_id in field_attach_delete() (line 927 of /opt/lampp/htdocs/d7/modules/field/field.attach.inc).
    * Notice: Undefined index: field_id in field_attach_delete() (line 927 of /opt/lampp/htdocs/d7/modules/field/field.attach.inc).
    * Notice: Undefined index: field_id in field_attach_delete() (line 927 of /opt/lampp/htdocs/d7/modules/field/field.attach.inc).
    * Notice: Undefined index: module in field_attach_delete() (line 935 of /opt/lampp/htdocs/d7/modules/field/field.attach.inc).
    * Notice: Trying to get property of non-object in _taxonomy_clean_field_cache() (line 1192 of /opt/lampp/htdocs/d7/modules/taxonomy/taxonomy.module).
    * Notice: Trying to get property of non-object in _taxonomy_clean_field_cache() (line 1192 of /opt/lampp/htdocs/d7/modules/taxonomy/taxonomy.module).
    * Notice: Trying to get property of non-object in _taxonomy_clean_field_cache() (line 1192 of /opt/lampp/htdocs/d7/modules/taxonomy/taxonomy.module).
    * Notice: Trying to get property of non-object in path_taxonomy_term_delete() (line 306 of /opt/lampp/htdocs/d7/modules/path/path.module).
    * Notice: Trying to get property of non-object in taxonomy_taxonomy_term_delete() (line 1449 of /opt/lampp/htdocs/d7/modules/taxonomy/taxonomy.module).
catch’s picture

Hmm, interesting one. There's currently nothing stopping people adding the forum field to bundles and using it for other purposes, and in D6 we don't delete the forum vocabulary either afaik. So probably there needs to be a 'create field if it doesn't exist' check in forum_install().

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new1.43 KB

I think i nailed it, it now keeps the taxonomy and the variable "forum_nav_vocabulary" after uninstall. And checks for the taxonomy_forums field on install.

chx’s picture

Status: Needs review » Needs work

Almost great but you need spaces on both sides of the = sign. (Yes. Drupal is VERY picky on its code style http://drupal.org/coding-standards )

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new1.43 KB

Here it is with the spaces.

catch’s picture

Status: Needs review » Needs work

Two more nitpicks:

$fieldcheck - we don't munge words together, so this would be $field_check

Also

+ // Create fields if info on "taxonomy_forums" field turns out empty
should end with a period/full stop.

Otherwise looks RTBC.

Anonymous’s picture

Fixed issues catch mentioned.

catch’s picture

Status: Needs work » Reviewed & tested by the community

Lovely! (please wait for test bot before commit).

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.