diff options
Diffstat (limited to 'modules/node.module')
-rw-r--r-- | modules/node.module | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/node.module b/modules/node.module index 1357eaa77..c548741a2 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1488,7 +1488,8 @@ function node_submit($node) { $node->teaser = isset($node->body) ? node_teaser($node->body, isset($node->format) ? $node->format : NULL) : ''; } - if (user_access('administer nodes')) { + $access = user_access('administer nodes'); + if ($access) { // Populate the "authored by" field. if ($account = user_load(array('name' => $node->name))) { $node->uid = $account->uid; @@ -1499,10 +1500,10 @@ function node_submit($node) { $node->created = $node->date ? strtotime($node->date) : NULL; } - else { - // Force defaults in case people modify the form: - $node_options = variable_get('node_options_'. $node->type, array('status', 'promote')); - foreach (array('status', 'moderate', 'promote', 'sticky', 'revision') as $key) { + // Force defaults in case people modify the form: + $node_options = variable_get('node_options_'. $node->type, array('status', 'promote')); + foreach (array('status', 'moderate', 'promote', 'sticky', 'revision') as $key) { + if (!$access || !isset($node->$key)) { $node->$key = in_array($key, $node_options); } } |