summaryrefslogtreecommitdiff
path: root/modules/book.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-11-25 15:58:08 +0000
committerDries Buytaert <dries@buytaert.net>2001-11-25 15:58:08 +0000
commit3c90763607f2089b69659487ea09fc5acf8e30b0 (patch)
tree976a57bd6938751445e3dbbde3dd94adc0ef2f3e /modules/book.module
parentc4d228a4b5d6f09da068b668ce8c4d3186e261e0 (diff)
downloadbrdo-3c90763607f2089b69659487ea09fc5acf8e30b0.tar.gz
brdo-3c90763607f2089b69659487ea09fc5acf8e30b0.tar.bz2
- Fixed a bug in node_submit() in that the user name was not always
correctly updated.
Diffstat (limited to 'modules/book.module')
-rw-r--r--modules/book.module16
1 files changed, 9 insertions, 7 deletions
diff --git a/modules/book.module b/modules/book.module
index be4c9f7b9..7f7d48409 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -63,7 +63,7 @@ function book_save($op, $node) {
** and are not promoted by derault. See also: book_load().
*/
- return array("created" => time(), "moderate" => 1, "name" => $user->name, "parent", "promote" => 0, "score" => 0, "status" => 1, "uid" => $user->uid, "users" => "", "revisions", "votes" => 0, "weight");
+ return array("created" => time(), "moderate" => 1, "parent", "promote" => 0, "score" => 0, "status" => 1, "users" => "", "revisions", "votes" => 0, "weight");
}
else if (user_access("adminster nodes")) {
/*
@@ -105,8 +105,14 @@ function book_load($node) {
** book page through the admin pages. See also: book_save().
*/
- $book->name = $user->name;
- $book->uid = $user->uid;
+ if ($user->uid) {
+ $book->uid = $user->uid;
+ $book->name = $user->name;
+ }
+ else {
+ $book->uid = 0;
+ $book->name = "";
+ }
}
/*
@@ -156,10 +162,6 @@ function book_form($node, $help, $error) {
*/
$output .= form_hidden("revision", 1);
-
- $node->uid = $user->uid; // $node is passed by reference
- $node->name = $user->name;
-
}
return $output;