Issue #1441950 by hefox: Node types removed from hook_node_info with base = 'node_content' cannot be deleted

merge-requests/26/head
David Rothstein 2015-03-30 16:38:49 -04:00
parent 9164413df6
commit d67fd28f14
1 changed files with 3 additions and 5 deletions

View File

@ -739,11 +739,9 @@ function _node_types_build($rebuild = FALSE) {
$type_db = $type_object->type; $type_db = $type_object->type;
// Original disabled value. // Original disabled value.
$disabled = $type_object->disabled; $disabled = $type_object->disabled;
// Check for node types from disabled modules and mark their types for removal. // Check for node types either from disabled modules or otherwise not defined
// Types defined by the node module in the database (rather than by a separate // and mark as disabled.
// module using hook_node_info) have a base value of 'node_content'. The isset() if (empty($type_object->custom) && empty($_node_types->types[$type_db])) {
// check prevents errors on old (pre-Drupal 7) databases.
if (isset($type_object->base) && $type_object->base != 'node_content' && empty($_node_types->types[$type_db])) {
$type_object->disabled = TRUE; $type_object->disabled = TRUE;
} }
if (isset($_node_types->types[$type_db])) { if (isset($_node_types->types[$type_db])) {