#53012, make "Create new revision" respect node type settings, patch by Zen
parent
efa8b042c9
commit
45092bdd5f
|
@ -1584,11 +1584,9 @@ function node_submit($node) {
|
||||||
$node->uid = $user->uid ? $user->uid : 0;
|
$node->uid = $user->uid ? $user->uid : 0;
|
||||||
// Force defaults in case people modify the form:
|
// Force defaults in case people modify the form:
|
||||||
$node_options = variable_get('node_options_'. $node->type, array('status', 'promote'));
|
$node_options = variable_get('node_options_'. $node->type, array('status', 'promote'));
|
||||||
$node->status = in_array('status', $node_options);
|
foreach (array('status', 'moderate', 'promote', 'sticky', 'revision') as $key) {
|
||||||
$node->moderate = in_array('moderate', $node_options);
|
$node->$key = in_array($key, $node_options);
|
||||||
$node->promote = in_array('promote', $node_options);
|
}
|
||||||
$node->sticky = in_array('sticky', $node_options);
|
|
||||||
$node->revision = in_array('revision', $node_options);
|
|
||||||
unset($node->created);
|
unset($node->created);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1710,7 +1708,11 @@ function node_form_array($node) {
|
||||||
$form['options'][$key] = array('#type' => 'value', '#value' => $node->$key);
|
$form['options'][$key] = array('#type' => 'value', '#value' => $node->$key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$form['#node'] = $node;
|
else {
|
||||||
|
// Nodes being edited should always be preset with the default revision setting.
|
||||||
|
$node->revision = in_array('revision', $node_options);
|
||||||
|
}
|
||||||
|
$form['#node'] = $node;
|
||||||
|
|
||||||
if (user_access('administer nodes')) {
|
if (user_access('administer nodes')) {
|
||||||
// Node author information
|
// Node author information
|
||||||
|
|
|
@ -1584,11 +1584,9 @@ function node_submit($node) {
|
||||||
$node->uid = $user->uid ? $user->uid : 0;
|
$node->uid = $user->uid ? $user->uid : 0;
|
||||||
// Force defaults in case people modify the form:
|
// Force defaults in case people modify the form:
|
||||||
$node_options = variable_get('node_options_'. $node->type, array('status', 'promote'));
|
$node_options = variable_get('node_options_'. $node->type, array('status', 'promote'));
|
||||||
$node->status = in_array('status', $node_options);
|
foreach (array('status', 'moderate', 'promote', 'sticky', 'revision') as $key) {
|
||||||
$node->moderate = in_array('moderate', $node_options);
|
$node->$key = in_array($key, $node_options);
|
||||||
$node->promote = in_array('promote', $node_options);
|
}
|
||||||
$node->sticky = in_array('sticky', $node_options);
|
|
||||||
$node->revision = in_array('revision', $node_options);
|
|
||||||
unset($node->created);
|
unset($node->created);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1710,7 +1708,11 @@ function node_form_array($node) {
|
||||||
$form['options'][$key] = array('#type' => 'value', '#value' => $node->$key);
|
$form['options'][$key] = array('#type' => 'value', '#value' => $node->$key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$form['#node'] = $node;
|
else {
|
||||||
|
// Nodes being edited should always be preset with the default revision setting.
|
||||||
|
$node->revision = in_array('revision', $node_options);
|
||||||
|
}
|
||||||
|
$form['#node'] = $node;
|
||||||
|
|
||||||
if (user_access('administer nodes')) {
|
if (user_access('administer nodes')) {
|
||||||
// Node author information
|
// Node author information
|
||||||
|
|
Loading…
Reference in New Issue