Closed (duplicate)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.x-dev
Component:
content.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Oct 2007 at 18:42 UTC
Updated:
7 Nov 2007 at 14:13 UTC
The content module implements a hook_node_type $op for delete, where it deletes the type tables, but it never deletes the field tables. The attached patch checks in content_field_instance_delete for when the $instances drops below 0 and then deletes {content_field_} tables.
I ran into this problem when I implemented a new module that uses CCK to store it's data. I create the CCK node types on hook_install and delete them on hook_uninstall. But because of the above problem, subsequent installs didn't work because the field tables still existed.
| Comment | File | Size | Author |
|---|---|---|---|
| node_type_delete_4.patch | 2.17 KB | douggreen |
Comments
Comment #1
karens commentedThis is part of a bigger problem. See http://drupal.org/node/97861. I'm currently working on a fix for the 6.x version. We won't get a complete solution in 5.x, but we could at least drop these tables.
Just to keep this topic in one place, let's move the discussion over there.
Comment #2
karens commentedMore digging into this issue... Those tables should have been uninstalled in the normal process and your code should be unnecessary, but the reason they weren't is not that there was no provision to remove the tables, but that once you disable your module (which obviously happens prior to uninstalling it) info about those tables is no longer available to CCK so it didn't know there was a table to delete. I'm working on a fix for this whole messy thing in 6.x (in the link I posted above) and then hopefully we can backport some (but probably not all) of the fix to 5.x.