Jump to:
| Project: | Drupal core |
| Version: | 5.x-dev |
| Component: | node system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
Here is what I experienced:
1. Called node_type_delete('my_content_type') from hook_uninstall()
2. node_type_delete() deleted from {node_type}
3. node_type_delete() called node_get_types(), which had not yet been initialized
4. node_type_delete() called module_invoke('node_type', 'delete', $info) with an empty variable
5. content_type_delete() failed
As-is, it works when deleting content types from the administrative page. We didn't notice this problem until now because node_menu() calls node_get_types() for the administrative pages, which initializes a static variable before node_type_delete() deletes from {node_types}.
The attached patch swaps two lines, calling node_get_types() before deleting from {node_type} in every case.
I experienced this with Drupal 5.x, but I see the same thing in Drupal 6.x so I am marking this for 6.x-dev.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| node_type_delete_3.patch | 486 bytes | Ignored: Check issue status. | None | None |
Comments
#1
+1. Great. I would mark it as RTBC if more people reviewed it.
#2
this is still a problem i ran into in HEAD when working on http://drupal.org/node/180432
tested, and works as advertized.
#3
Thanks, committed.
#4
Erm, also an issue in 5.x, so needs backporting.
#5
Marking as won't fix as d5 is end of life.