I think it needs some more detailed wording. How about:

Drupal 5

Remove any information that the module sets itself. This includes:

  • variables the module has set using variable_set
  • variables the module can set indirectly in its forms, like the settings form
  • blocks that the module defines
  • tables the module created

The module should not remove its entry from the {system] table.

The uninstall hook will fire when the module gets uninstalled.

Drupal 6

Remove any information that the module sets itself. This includes:

  • variables the module has set using variable_set
  • variables the module can set indirectly in its forms, like the settings form
  • blocks that the module defines
  • the module schema

The module should not remove its entry from the {system] table.

The uninstall hook will fire when the module gets uninstalled.

See for instance http://drupal.org/node/211175 about these practices.

Comments

fgm’s picture

Status: Active » Needs review

Forgot to set status. It's not a patch as such, but the suggested content is in the previous post.

Barry Madore’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Documentation in CVS » documentation

Moving

fgm’s picture

Also, node modules should probably remove the nodes of the types they manage.

Anonymous’s picture

Status: Needs review » Active

Since there is no real patch in this issue changing back to active. The issue #211175: GHOP #156: Write hook_uninstall: Task 2 you referred to is closed.

dave reid’s picture

Assigned: Unassigned » dave reid

I just worked on editing a new possible hook so I'll take a stab at this soon.

dave reid’s picture

Status: Active » Fixed

I'm not going to write anything about removing blocks, because that gets messy; you'd need to remove actions, filters, node types (and nodes of those node types), permissions, etc. I'm working on uninstalling those items automatically in core with #306151: Automatically install/uninstall schema.

Just committed my change to the 7.x documentation. It should be available at http://api.drupal.org/api/function/hook_uninstall/7 shortly. Take a look and let me know what you all think. If it looks good, I'll start backporting the documentation to 6.x and 5.x. Marked as fixed for now.

dave reid’s picture

Don't know how long the API takes to regenerate, but here's the commit: http://drupal.org/cvs?commit=139777

Anonymous’s picture

Status: Fixed » Closed (fixed)

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