Commit c2384e2c authored by Steven Wittens's avatar Steven Wittens
Browse files

- #41973: Ensure -\>changed and -\>created are equal on node creation

parent 69bcdef5
...@@ -425,8 +425,11 @@ function node_save(&$node) { ...@@ -425,8 +425,11 @@ function node_save(&$node) {
} }
} }
// If node has never changed, set $node->changed to $node->created
// If we set $node->created to time(), then 'changed' and 'created' will be
// different for new nodes which were previewed before submission
// The changed timestamp is always updated for bookkeeping purposes (revisions, searching, ...) // The changed timestamp is always updated for bookkeeping purposes (revisions, searching, ...)
$node->changed = time(); $node->changed = $node->changed ? time() : $node->created;
// Split off revisions data to another structure // Split off revisions data to another structure
$revisions_table_values = array('nid' => $node->nid, 'vid' => $node->vid, $revisions_table_values = array('nid' => $node->nid, 'vid' => $node->vid,
......
...@@ -425,8 +425,11 @@ function node_save(&$node) { ...@@ -425,8 +425,11 @@ function node_save(&$node) {
} }
} }
// If node has never changed, set $node->changed to $node->created
// If we set $node->created to time(), then 'changed' and 'created' will be
// different for new nodes which were previewed before submission
// The changed timestamp is always updated for bookkeeping purposes (revisions, searching, ...) // The changed timestamp is always updated for bookkeeping purposes (revisions, searching, ...)
$node->changed = time(); $node->changed = $node->changed ? time() : $node->created;
// Split off revisions data to another structure // Split off revisions data to another structure
$revisions_table_values = array('nid' => $node->nid, 'vid' => $node->vid, $revisions_table_values = array('nid' => $node->nid, 'vid' => $node->vid,
......
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