- Patch #223771 by Arancaytar, Amitaibu: node_body_field does not check ->has_body.
parent
a98905f5c6
commit
f0940b1dbf
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)));
|
||||
|
|
Loading…
Reference in New Issue