summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/node/node.pages.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 7a9e141bb..a85b2afcf 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -144,7 +144,9 @@ function node_form($form, &$form_state, $node) {
if (function_exists($function) && ($extra = $function($node, $form_state))) {
$form = array_merge_recursive($form, $extra);
}
- if (!isset($form['title']['#weight'])) {
+ // If the node type has a title, and the node type form defined no special
+ // weight for it, we default to a weight of -5 for consistency.
+ if (isset($form['title']) && !isset($form['title']['#weight'])) {
$form['title']['#weight'] = -5;
}
// @todo D8: Remove. Modules should access the node using $form_state['node'].