summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-05-05 15:11:51 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-05-05 15:11:51 +0000
commit744f5a87a346910154d38d144f272017106c55f9 (patch)
tree208d7ffa5f4df184bc25bdbc9d15d48d480c2292
parent108677607dee12278ec177786ea28ad1b7f3b3d5 (diff)
downloadbrdo-744f5a87a346910154d38d144f272017106c55f9.tar.gz
brdo-744f5a87a346910154d38d144f272017106c55f9.tar.bz2
#553306 by catch, bec, yched, zzolo, mradcliffe, webchick, plach: The rest of remove redundant body and title node attributes &amp; UI. The rest was accidentally committed in http://drupal.org/cvs?commit=363156. Sorry. :(
-rw-r--r--modules/blog/blog.install17
-rw-r--r--modules/node/node.install22
2 files changed, 34 insertions, 5 deletions
diff --git a/modules/blog/blog.install b/modules/blog/blog.install
new file mode 100644
index 000000000..898ff5749
--- /dev/null
+++ b/modules/blog/blog.install
@@ -0,0 +1,17 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Install, update and uninstall functions for the blog module.
+ */
+
+/**
+ * Implements hook_install().
+ */
+function blog_install() {
+ // Ensure the blog node type is available.
+ node_types_rebuild();
+ $types = node_type_get_types();
+ node_add_body_field($types['blog']);
+}
diff --git a/modules/node/node.install b/modules/node/node.install
index 6b8804179..bec99b080 100644
--- a/modules/node/node.install
+++ b/modules/node/node.install
@@ -491,11 +491,20 @@ function node_update_7006(&$sandbox) {
if (!isset($sandbox['total'])) {
// Initial invocation.
- // Re-save node types to create body field instances.
- foreach ($node_types as $type => $info) {
- if ($info->has_body) {
- node_type_save($info);
+ // Get node type info, specifically the body field settings.
+ $result = db_select('node_type', 'node_type')
+ ->fields('node_type')
+ ->execute();
+
+ // Add body field instances for existing node types.
+ foreach ($result as $node_type) {
+ if ($node_type->has_body) {
+ node_add_body_field($node_type->type, $node_type->body_label);
}
+
+ $sandbox['node_types_info'][$node_type->type] = array(
+ 'has_body' => $node_type->has_body,
+ );
}
// Initialize state for future calls.
@@ -592,9 +601,12 @@ function node_update_7006(&$sandbox) {
db_drop_field('node_revision', 'teaser');
db_drop_field('node_revision', 'format');
+ // Remove node_type properties related to the former 'body'.
+ db_drop_field('node_type', 'has_body');
+ db_drop_field('node_type', 'body_label');
+
// We're done.
$sandbox['#finished'] = 1;
- return t("!number node body and teaser properties migrated to the 'body' field.", array('!number' => $sandbox['total']));
}
}
}