summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-05-25 15:39:12 +0000
committerDries Buytaert <dries@buytaert.net>2009-05-25 15:39:12 +0000
commitf0940b1dbf630c438bf99fb21dd62518cebfd81a (patch)
treee416ff08bd3a5ef94f3ed1f806f794b3896a01a6 /modules
parenta98905f5c6696ef166ec797fc6ee80fe8f94f48f (diff)
downloadbrdo-f0940b1dbf630c438bf99fb21dd62518cebfd81a.tar.gz
brdo-f0940b1dbf630c438bf99fb21dd62518cebfd81a.tar.bz2
- Patch #223771 by Arancaytar, Amitaibu: node_body_field does not check ->has_body.
Diffstat (limited to 'modules')
-rw-r--r--modules/node/node.module4
-rw-r--r--modules/node/node.pages.inc4
2 files changed, 5 insertions, 3 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 9cddfde7d..6129ed46f 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -2908,9 +2908,7 @@ function node_content_form($node, $form_state) {
);
}
- if ($type->has_body) {
- $form['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count);
- }
+ $form['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count);
return $form;
}
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 1271efd42..4b9755a0e 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -289,6 +289,10 @@ function node_form(&$form_state, $node) {
* Return a node body field, with format and teaser.
*/
function node_body_field($node, $label, $word_count) {
+ // Do not generate a body field if the type does not specify one.
+ if (!node_get_types('type', $node)->has_body) {
+ return array();
+ }
// Check if we need to restore the teaser at the beginning of the body.
$include = !isset($node->teaser) || ($node->teaser == substr($node->body, 0, strlen($node->teaser)));