summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-08-23 06:38:49 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-08-23 06:38:49 +0000
commit055844e74ff3a4cb8de09db274c8260b966baac7 (patch)
treea81384c7ab7230923d52d0fe5c263501b1f6497e
parenta58d877108f6b7ff6712c6261815c6092c7f6949 (diff)
downloadbrdo-055844e74ff3a4cb8de09db274c8260b966baac7.tar.gz
brdo-055844e74ff3a4cb8de09db274c8260b966baac7.tar.bz2
#4074 by riccardoR, save the book weights if they aren't editable.
-rw-r--r--modules/book/book.module10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/book/book.module b/modules/book/book.module
index cd402393d..f93d30178 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -220,7 +220,6 @@ function book_submit(&$node) {
global $user;
// Set default values for non-administrators.
if (!user_access('administer nodes')) {
- $node->weight = 0;
$node->revision = 1;
$book->uid = $user->uid;
$book->name = $user->uid ? $user->name : '';
@@ -276,9 +275,12 @@ function book_form(&$node) {
);
}
else {
- // If a regular user updates a book page, we create a new revision
- // authored by that user:
- $form['revision'] = array('#type' => 'hidden', '#value' => 1);
+ // If a regular user updates a book page, we preserve the node weight; otherwise
+ // we use 0 as the default for new pages
+ $form['weight'] = array(
+ '#type' => 'value',
+ '#value' => isset($node->weight) ? $node->weight : 0,
+ );
}
return $form;