In the comment on the issue about data not being deleted when field instances are removed, there is a comment about deciding when it is best to delete the data. According to http://drupal.org/node/97861#comment-622042 and comments after, there seems to be a solution that deletes data when field modules are uninstalled, not when they are merely disabled.
I think the same thing should happen with modules that implement hook_node_info(). Currently, if field instances are put on node types that come from other modules, disabling those modules will cause CCK to delete the field instance table. If the node type modules are reenabled for some reason, they won't have any CCK data on them at all. The modules weren't uninstalled, so those nodes will still have their module specific data. That kind of inconsistency is jarring the first time it is encountered. Even worse, there's no warning that this will happen.
Comments
Comment #1
yched commentedI'm afraid there's not much we can do about it - we get the 'existing content types' from core's node.module, so if anything this would be a bug/request for core.
Comment #2
Island Usurper commentedMarked #266786: Prevent node types and their CCK data being deleted when disabling module as duplicate.
I haven't yet looked into a solution for this, and I'm starting to think that was a mistake. Oh well, it's water under the bridge now. The main problem now is figuring out a way to preserve the knowledge of disabled node types for CCK's use. As a temporary fix from the node type module, hook_disable() might be able to set the "module" field in {node_type} to node, and hook_enable() can reclaim it. The type's machine-readable name stays the same, so hook_nodeapi() would still work. The node type module's database info should stay where it is, completely unused, until it is reenabled or uninstalled.
If every node type module needs this done, then it's really the core node type handling code that should do it.
Comment #3
johnalbinsubscribing
Comment #4
Island Usurper commentedMore detailed explanation of what's happening in comment #3: #266786-3: Prevent node types and their CCK data being deleted when disabling module
Comment #5
drummLooks like something that needs to be solved in the development version.
Comment #6
catchSomewhat related to: http://drupal.org/node/232327 - deleting a content type also leaves orphaned nodes/fields.
Comment #7
yched commentedThis has been 'fixed' in #292872: fields and data are deleted when a content-type module is disabled
We do not remove fields and field data from disabled types anymore. Since core does not inform us of uninstalled modules, this stale data remains in the db...
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.