summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt2
-rw-r--r--modules/node/node.install10
-rw-r--r--modules/node/node.module8
3 files changed, 17 insertions, 3 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 4ed9724ab..29b1f4f62 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,8 @@
Drupal 7.37, xxxx-xx-xx (development version)
-----------------------
+- Fixed a regression in Drupal 7.36 which caused certain kinds of content types
+ to become disabled if they were defined by a no-longer-enabled module.
- Removed a confusing description regarding automatic time zone detection from
the user account form (minor UI and data structure change).
- Allowed custom HTML tags with a dash in the name to pass through filter_xss()
diff --git a/modules/node/node.install b/modules/node/node.install
index 76c2aec28..0b0a7bd5a 100644
--- a/modules/node/node.install
+++ b/modules/node/node.install
@@ -934,5 +934,15 @@ function node_update_7014() {
}
/**
+ * Enable node types that may have been erroneously disabled in Drupal 7.36.
+ */
+function node_update_7015() {
+ db_update('node_type')
+ ->fields(array('disabled' => 0))
+ ->condition('base', 'node_content')
+ ->execute();
+}
+
+/**
* @} End of "addtogroup updates-7.x-extra".
*/
diff --git a/modules/node/node.module b/modules/node/node.module
index fd848e246..7a6246d5a 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -740,9 +740,11 @@ function _node_types_build($rebuild = FALSE) {
$type_db = $type_object->type;
// Original disabled value.
$disabled = $type_object->disabled;
- // Check for node types either from disabled modules or otherwise not defined
- // and mark as disabled.
- if (empty($type_object->custom) && empty($_node_types->types[$type_db])) {
+ // Check for node types from disabled modules and mark their types for removal.
+ // Types defined by the node module in the database (rather than by a separate
+ // module using hook_node_info) have a base value of 'node_content'. The isset()
+ // 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;
}
if (isset($_node_types->types[$type_db])) {