The function book_validate reset book page weight to 0 for non administer users which is incosistent. It shoulb be set to 0 only for new book page but not for updated ones.

I suggest

function book_validate(&$node) {
// Set default values for non-administrators.
if (!user_access('administer nodes')) {
$node->weight = 0;
$node->revision = 1;
}
}

to become

function book_validate(&$node) {
// Set default values for non-administrators.
if (!user_access('administer nodes')) {
if (!isset ($node->weight)) $node->weight = 0;
$node->revision = 1;
}
}

Comments

travischristopher’s picture

Priority: Normal » Critical

1+

this is a pretty critical change, if other users are maintaining books it it can really screw up the weighting system.

jo1ene’s picture

Priority: Critical » Minor
Status: Active » Closed (fixed)

This function no longer exists in the book module as quoted anymore (as of 4.7). This is what we have now.

function book_validate($node) {
  node_validate_title($node);
}

This calls a function in the node module, which deals with the title.

function node_validate_title($node, $message = NULL) {
  // Validate the title field.
  if (isset($node->title)) {
    if (trim($node->title) == '') {
      form_set_error('title', isset($message) ? $message : t('You have to specify a title.'));
    }
  }
}

If this problem still exists, let's reopen this for the 4.7 version.