diff options
author | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2002-10-17 09:21:03 +0000 |
---|---|---|
committer | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2002-10-17 09:21:03 +0000 |
commit | 623397d6dd943e6477a6b339e01fe44a5de8c6db (patch) | |
tree | 152ee4512dcefd8e4f113e6f20437b5bbc75090a /modules/node.module | |
parent | 980f0700a1aa75f8a5d3b1208c6025fe4eac8e41 (diff) | |
download | brdo-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.module')
-rw-r--r-- | modules/node.module | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/node.module b/modules/node.module index c0fd6ac16..398404aee 100644 --- a/modules/node.module +++ b/modules/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 { |