Commit 54dfc577 authored by Steven Wittens's avatar Steven Wittens
Browse files

- #19353: Fix 'submit' button behaviour wrt optional previewing and form errors.

parent bf312dfe
......@@ -1368,13 +1368,8 @@ function node_form($edit) {
// Add the buttons.
$output .= form_submit(t('Preview'));
if (!form_get_errors()) {
if ($edit->title && $edit->type) {
$output .= form_submit(t('Submit'));
}
elseif (!variable_get('node_preview', 0)) {
$output .= form_submit(t('Submit'));
}
if ($edit->type && (($_POST['op'] == t('Preview') && !form_get_errors()) || !variable_get('node_preview', 0))) {
$output .= form_submit(t('Submit'));
}
if ($edit->nid && node_access('delete', $edit)) {
......
......@@ -1368,13 +1368,8 @@ function node_form($edit) {
// Add the buttons.
$output .= form_submit(t('Preview'));
if (!form_get_errors()) {
if ($edit->title && $edit->type) {
$output .= form_submit(t('Submit'));
}
elseif (!variable_get('node_preview', 0)) {
$output .= form_submit(t('Submit'));
}
if ($edit->type && (($_POST['op'] == t('Preview') && !form_get_errors()) || !variable_get('node_preview', 0))) {
$output .= form_submit(t('Submit'));
}
if ($edit->nid && node_access('delete', $edit)) {
......
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