Commit ac43420b authored by Gábor Hojtsy's avatar Gábor Hojtsy

#86857 by pwolanin and webchick: autogenerate log message for book page...

#86857 by pwolanin and webchick: autogenerate log message for book page changes when made from the outline view (ie. node title or weight can be changed and is now in the log message)
parent 7a8773ef
......@@ -92,10 +92,21 @@ function book_admin_edit_submit($form, &$form_state) {
$node = node_load($row['nid'], FALSE);
if ($row['title'] != $node->title || $row['weight'] != $node->book['weight']) {
// Record changes in node's log message.
$log_messages = array();
if ($row['title'] != $node->title) {
$log_messages[] = t('Title changed from %original to %current.', array('%original' => $node->title, '%current' => $row['title']));
}
if ($row['weight'] != $node->book['weight']) {
$log_messages[] = t('Weight changed from %original to %current.', array('%original' => $node->book['weight'], '%current' => $row['weight']));
}
$node->title = $row['title'];
$node->book['link_title'] = $row['title'];
$node->book['weight'] = $row['weight'];
$node->revision = 1;
$node->log = implode(' ', $log_messages);
node_save($node);
watchdog('content', 'book: updated %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid));
......
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