Commit 8e1e221e authored by Gerhard Killesreiter's avatar Gerhard Killesreiter
Browse files

#52710, fix node timestamp for admin users, patch by hunmonk.

parent 9794b553
......@@ -1503,7 +1503,7 @@ function node_submit($node) {
$node->uid = 0;
}
$node->created = strtotime($node->date);
$node->created = $node->date ? strtotime($node->date) : NULL;
}
else {
// Force defaults in case people modify the form:
......@@ -1629,7 +1629,16 @@ function node_form_array($node) {
// Node author information
$form['author'] = array('#type' => 'fieldset', '#title' => t('Authoring information'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 20);
$form['author']['name'] = array('#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, '#autocomplete_path' => 'user/autocomplete', '#default_value' => $node->name ? $node->name : '', '#weight' => -1, '#description' => t('Leave blank for %anonymous.', array('%anonymous' => theme('placeholder', variable_get('anonymous', 'Anonymous')))));
$form['author']['date'] = array('#type' => 'textfield', '#title' => t('Authored on'), '#maxlength' => 25, '#required' => TRUE, '#default_value' => $node->date);
$form['author']['date'] = array('#type' => 'textfield', '#title' => t('Authored on'), '#maxlength' => 25);
// For new node creations only display a reference to the time of creation,
// so node creation time defaults to form submission time.
if (!isset($node->nid)) {
$form['author']['date']['#description'] = t('Format: %time (defaults to time of form submission)', array('%time' => $node->date));
}
else {
$form['author']['date']['#default_value'] = $node->date;
$form['author']['date']['#required'] = TRUE;
}
// Node options for administrators
$form['options'] = array('#type' => 'fieldset', '#title' => t('Publishing options'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 25);
......
......@@ -1503,7 +1503,7 @@ function node_submit($node) {
$node->uid = 0;
}
$node->created = strtotime($node->date);
$node->created = $node->date ? strtotime($node->date) : NULL;
}
else {
// Force defaults in case people modify the form:
......@@ -1629,7 +1629,16 @@ function node_form_array($node) {
// Node author information
$form['author'] = array('#type' => 'fieldset', '#title' => t('Authoring information'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 20);
$form['author']['name'] = array('#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, '#autocomplete_path' => 'user/autocomplete', '#default_value' => $node->name ? $node->name : '', '#weight' => -1, '#description' => t('Leave blank for %anonymous.', array('%anonymous' => theme('placeholder', variable_get('anonymous', 'Anonymous')))));
$form['author']['date'] = array('#type' => 'textfield', '#title' => t('Authored on'), '#maxlength' => 25, '#required' => TRUE, '#default_value' => $node->date);
$form['author']['date'] = array('#type' => 'textfield', '#title' => t('Authored on'), '#maxlength' => 25);
// For new node creations only display a reference to the time of creation,
// so node creation time defaults to form submission time.
if (!isset($node->nid)) {
$form['author']['date']['#description'] = t('Format: %time (defaults to time of form submission)', array('%time' => $node->date));
}
else {
$form['author']['date']['#default_value'] = $node->date;
$form['author']['date']['#required'] = TRUE;
}
// Node options for administrators
$form['options'] = array('#type' => 'fieldset', '#title' => t('Publishing options'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 25);
......
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