summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-06-07 03:45:57 +0000
committerDries Buytaert <dries@buytaert.net>2007-06-07 03:45:57 +0000
commit546719769bcd61d7df7cb640effda3fcbf1131d7 (patch)
tree9b515e822f1b612cd2f2135b67b6a8a8c93f21ed
parent36cdf06140dec5a288e86663b236bb98280db1be (diff)
downloadbrdo-546719769bcd61d7df7cb640effda3fcbf1131d7.tar.gz
brdo-546719769bcd61d7df7cb640effda3fcbf1131d7.tar.bz2
- Patch #101319 by pwolanin: make sure that node->revision can be altered.
-rw-r--r--modules/node/node.module25
1 files changed, 13 insertions, 12 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 14cddb13a..1df162468 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -2022,6 +2022,19 @@ function node_object_prepare(&$node) {
$node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
}
}
+
+ $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') as $key) {
+ $node->$key = in_array($key, $node_options);
+ }
+ global $user;
+ $node->uid = $user->uid;
+ }
+ // Always use the default revision setting.
+ $node->revision = in_array('revision', $node_options);
+
node_invoke($node, 'prepare');
node_invoke_nodeapi($node, 'prepare');
}
@@ -2067,18 +2080,6 @@ function node_form(&$form_state, $node) {
$form['title']['#weight'] = -5;
}
- $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') as $key) {
- $node->$key = in_array($key, $node_options);
- }
- global $user;
- $node->uid = $user->uid;
- }
- // 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