From 1d2e7683abf643bb04856d5a58e8d2bb7dc4e860 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 23 Oct 2010 16:30:48 +0000 Subject: #433454 by sun: Only hardcode node title's weight if it's not otherwise specified. --- modules/node/node.pages.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules') 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']. -- cgit v1.2.3