diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-03-01 18:18:22 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-03-01 18:18:22 +0000 |
commit | 6ee8563edbd2ef7002ccc8cc1527e0abc9be27b6 (patch) | |
tree | 9e4dd547e0d1e4956937b58b16ce718ddc681749 /modules/node/node.module | |
parent | be6c0be443859f6255171c871524c24ed96d1027 (diff) | |
download | brdo-6ee8563edbd2ef7002ccc8cc1527e0abc9be27b6.tar.gz brdo-6ee8563edbd2ef7002ccc8cc1527e0abc9be27b6.tar.bz2 |
- Patch #114822 by Neil et al: revision flag was ignored.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r-- | modules/node/node.module | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index 98eae0e42..192509e27 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1842,8 +1842,7 @@ function node_submit($node) { $node->teaser = isset($node->body) ? node_teaser($node->body, isset($node->format) ? $node->format : NULL) : ''; } - $access = user_access('administer nodes'); - if ($access) { + if (user_access('administer nodes')) { // Populate the "authored by" field. if ($account = user_load(array('name' => $node->name))) { $node->uid = $account->uid; @@ -1855,24 +1854,6 @@ function node_submit($node) { $node->created = $node->date ? strtotime($node->date) : NULL; } - // Process the workflow options and provide defaults. If the user - // can not administer nodes, ignore the form and either use the - // saved values if the node exists, or force the defaults. - if (!$access && $node->nid) { - $saved_node = node_load($node->nid); - } - else { - $node_options = variable_get('node_options_'. $node->type, array('status', 'promote')); - } - foreach (array('status', 'promote', 'sticky', 'revision') as $key) { - if (!$access && $node->nid) { - $node->$key = $saved_node->$key; - } - else if (!isset($node->$key) || !$access) { - $node->$key = in_array($key, $node_options); - } - } - // Do node-type-specific validation checks. node_invoke($node, 'submit'); node_invoke_nodeapi($node, 'submit'); @@ -1973,16 +1954,15 @@ function node_form($node, $form_values = NULL) { $node_options = variable_get('node_options_'. $node->type, array('status', 'promote')); // If this is a new node, fill in the default values. if (!isset($node->nid)) { - foreach (array('status', 'promote', 'sticky', 'revision') as $key) { + foreach (array('status', 'promote', 'sticky') as $key) { $node->$key = in_array($key, $node_options); } global $user; $node->uid = $user->uid; } - else { - // Nodes being edited should always be preset with the default revision setting. - $node->revision = in_array('revision', $node_options); - } + // Always use the default revision setting. + $node->revision = in_array('revision', $node_options); + $form['#node'] = $node; // Add a log field if the "Create new revision" option is checked, or if the |