summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2002-10-17 09:21:03 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2002-10-17 09:21:03 +0000
commit623397d6dd943e6477a6b339e01fe44a5de8c6db (patch)
tree152ee4512dcefd8e4f113e6f20437b5bbc75090a /modules/node
parent980f0700a1aa75f8a5d3b1208c6025fe4eac8e41 (diff)
downloadbrdo-623397d6dd943e6477a6b339e01fe44a5de8c6db.tar.gz
brdo-623397d6dd943e6477a6b339e01fe44a5de8c6db.tar.bz2
- fixing the logic for populating $node when adding a new node. Title, teaser,
body will now be set correctly, or be left unset if no values are included in the request.
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.module8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index c0fd6ac16..398404aee 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -928,7 +928,13 @@ function node_add($type) {
if ($type && node_access("create", $type)) {
// Initialize settings
- $output = node_form(array("uid" => $user->uid, "name" => $user->name, "type" => $type, "status" => 1, "promote" => !module_exist("queue"), "moderate" => module_exist("queue"), "comment" => module_exist("queue") ? 2 : 0, "title" => check_input($edit["title"]), "body" => check_input($edit["body"])));
+ $node = array("uid" => $user->uid, "name" => $user->name, "type" => $type, "status" => 1, "promote" => !module_exist("queue"), "moderate" => module_exist("queue"), "comment" => module_exist("queue") ? 2 : 0);
+ foreach (array("title", "teaser", "body") as $field) {
+ if ($edit[$field]) {
+ $node[$field] = check_input($edit[$field]);
+ }
+ }
+ $output = node_form($node);
}
else {