Commit 2510f322 authored by Dries's avatar Dries

- Modified patch #10613 by killes: generate a 'page not found'-page when a...

- Modified patch #10613 by killes: generate a 'page not found'-page when a requested node does not exist.  I modified the patch to avoid duplicate 'not found'-checking in the second bulk.
parent 5f28d97a
...@@ -665,7 +665,7 @@ function node_menu($may_cache) { ...@@ -665,7 +665,7 @@ function node_menu($may_cache) {
else { else {
if (arg(0) == 'node' && is_numeric(arg(1))) { if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(array('nid' => arg(1))); $node = node_load(array('nid' => arg(1)));
if ($node->nid) {
$items[] = array('path' => 'node/'. arg(1), 'title' => t('view'), $items[] = array('path' => 'node/'. arg(1), 'title' => t('view'),
'callback' => 'node_page', 'callback' => 'node_page',
'access' => node_access('view', $node), 'access' => node_access('view', $node),
...@@ -687,6 +687,7 @@ function node_menu($may_cache) { ...@@ -687,6 +687,7 @@ function node_menu($may_cache) {
} }
} }
} }
}
return $items; return $items;
} }
...@@ -1474,8 +1475,9 @@ function node_page() { ...@@ -1474,8 +1475,9 @@ function node_page() {
break; break;
case 'view': case 'view':
if (is_numeric(arg(1))) { if (is_numeric(arg(1))) {
if ($node = node_load(array('nid' => arg(1)), $_GET['revision'])) { $node = node_load(array('nid' => arg(1)), $_GET['revision']);
print theme('page', node_show($node, arg(3)), $node->title); if ($node->nid) {
print theme('page', node_show($node, arg(2)), $node->title);
} }
else { else {
drupal_not_found(); drupal_not_found();
......
...@@ -665,7 +665,7 @@ function node_menu($may_cache) { ...@@ -665,7 +665,7 @@ function node_menu($may_cache) {
else { else {
if (arg(0) == 'node' && is_numeric(arg(1))) { if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(array('nid' => arg(1))); $node = node_load(array('nid' => arg(1)));
if ($node->nid) {
$items[] = array('path' => 'node/'. arg(1), 'title' => t('view'), $items[] = array('path' => 'node/'. arg(1), 'title' => t('view'),
'callback' => 'node_page', 'callback' => 'node_page',
'access' => node_access('view', $node), 'access' => node_access('view', $node),
...@@ -687,6 +687,7 @@ function node_menu($may_cache) { ...@@ -687,6 +687,7 @@ function node_menu($may_cache) {
} }
} }
} }
}
return $items; return $items;
} }
...@@ -1474,8 +1475,9 @@ function node_page() { ...@@ -1474,8 +1475,9 @@ function node_page() {
break; break;
case 'view': case 'view':
if (is_numeric(arg(1))) { if (is_numeric(arg(1))) {
if ($node = node_load(array('nid' => arg(1)), $_GET['revision'])) { $node = node_load(array('nid' => arg(1)), $_GET['revision']);
print theme('page', node_show($node, arg(3)), $node->title); if ($node->nid) {
print theme('page', node_show($node, arg(2)), $node->title);
} }
else { else {
drupal_not_found(); drupal_not_found();
......
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