Commit 055844e7 authored by drumm's avatar drumm

#4074 by riccardoR, save the book weights if they aren't editable.

parent a58d8771
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment