summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-23 16:30:48 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-23 16:30:48 +0000
commit1d2e7683abf643bb04856d5a58e8d2bb7dc4e860 (patch)
treee996bf088e02cf89f5f500486c339853a64acb2a
parent156dec00af69e26b42335a6b0f66483ce522996f (diff)
downloadbrdo-1d2e7683abf643bb04856d5a58e8d2bb7dc4e860.tar.gz
brdo-1d2e7683abf643bb04856d5a58e8d2bb7dc4e860.tar.bz2
#433454 by sun: Only hardcode node title's weight if it's not otherwise specified.
-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'].