summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-03-26 01:03:29 +0000
committerGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-03-26 01:03:29 +0000
commita21ff722702c5e05dc034489dcdadcaa14161e4a (patch)
tree9526cd4498ae188b8cfb1f1bf72744c86d66c188 /modules
parent9bbd6f63a30e38d0febe503a5589083e4c220c08 (diff)
downloadbrdo-a21ff722702c5e05dc034489dcdadcaa14161e4a.tar.gz
brdo-a21ff722702c5e05dc034489dcdadcaa14161e4a.tar.bz2
#55632, After deleting the last revision of a node, you're sent to an invalid path, patch by dww
Diffstat (limited to 'modules')
-rw-r--r--modules/node.module8
-rw-r--r--modules/node/node.module8
2 files changed, 12 insertions, 4 deletions
diff --git a/modules/node.module b/modules/node.module
index d3eba09ec..f9821bf3a 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -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");
+ }
}
}
diff --git a/modules/node/node.module b/modules/node/node.module
index d3eba09ec..f9821bf3a 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -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");
+ }
}
}