diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-08-23 06:38:49 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-08-23 06:38:49 +0000 |
commit | 055844e74ff3a4cb8de09db274c8260b966baac7 (patch) | |
tree | a81384c7ab7230923d52d0fe5c263501b1f6497e /modules | |
parent | a58d877108f6b7ff6712c6261815c6092c7f6949 (diff) | |
download | brdo-055844e74ff3a4cb8de09db274c8260b966baac7.tar.gz brdo-055844e74ff3a4cb8de09db274c8260b966baac7.tar.bz2 |
#4074 by riccardoR, save the book weights if they aren't editable.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/book/book.module | 10 |
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; |