1) Create a module with hook_node_info that has a node type with 'base' equal to 'node_content'
2) Enable, check for at structures => content types.
3) Disable module or remove hook_node_info
4) clear cache
The node type will appear under 'content types' still, but be unable to be deleted (or otherwise removed without deleting the node type).
Contrib issue about problem #1055460: Disabling a feature does not disown content type
Patch attach changes the check of base == 'node_content' to empty(custom). As far as I can tell, custom is what it should be checking anyway as !custom indicates the node type was defined from a module (whereas modified indicates the node type has been updated).
This has the effect of node type in that state is instead marked as disabled.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 1441950-drupal_node_types_custom-8.patch | 1.03 KB | hefox |
| drupal_hook_node_info_node_content_base.patch | 1.05 KB | hefox |
Comments
Comment #1
tim.plunkettTagging for potential backport.
Comment #2
hefox commentedComment #3
kscheirerdrupal_hook_node_info_node_content_base.patch queued for re-testing.
Comment #4
kscheirerRetesting against latest HEAD since it has been over a year.
Comment #6
hefox commentedMoving this to d7 because node_content is only referenced once in core, node types are now defined via config, etc.
Comment #7
hefox commentedComment #9
hefox commentedOops, backported wrong
Comment #14
Leeteq commentedThis core bug has major consequences for other modules / administration.
Comment #16
jaffaralia commentedI checked this patch was working fine.
Comment #19
David_Rothstein commentedTestbot fluke.
Comment #20
David_Rothstein commentedI think this makes sense.. and existing tests for the node type disabling are somewhat extensive and pass with this patch, so I guess we don't really need new tests for this.
Committed to 7.x - thanks!
Comment #22
maximpodorov commentedThis commit creates a new problem: #2465159: 7.36 (Issue #1441950) May Cause Node Types to be disabled
Comment #24
David_Rothstein commentedReopening this, since it was reverted in #2465159: 7.36 (Issue #1441950) May Cause Node Types to be disabled.
We can try again if we can figure out how to deal with the regression discussed there. It's definitely a legit bug fix, but that side effect was causing too many problems for some people.