Commit a21ff722 authored by Gerhard Killesreiter's avatar Gerhard Killesreiter
Browse files

#55632, After deleting the last revision of a node, you're sent to an invalid path, patch by dww

parent 9bbd6f63
......@@ -1427,8 +1427,12 @@ function node_revision_delete($nid, $revision) {
else {
drupal_set_message(t('Deletion failed. You tried to delete the current revision.'));
}
drupal_goto("node/$nid/revisions");
if (db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $nid)) > 1) {
drupal_goto("node/$nid/revisions");
}
else {
drupal_goto("node/$nid");
}
}
}
......
......@@ -1427,8 +1427,12 @@ function node_revision_delete($nid, $revision) {
else {
drupal_set_message(t('Deletion failed. You tried to delete the current revision.'));
}
drupal_goto("node/$nid/revisions");
if (db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $nid)) > 1) {
drupal_goto("node/$nid/revisions");
}
else {
drupal_goto("node/$nid");
}
}
}
......
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