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

4.7.x
Gerhard Killesreiter 2006-04-08 13:13:17 +00:00
parent 9794b5538e
commit 8e1e221e30
2 changed files with 22 additions and 4 deletions

View File

@ -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);

View File

@ -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);