From 110080c533388fb87d6c22fd5ea287a4b86d5e54 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Sun, 14 Jan 2007 02:12:29 +0000 Subject: #108695: Fix problem with using nodes as 404/403 pages. --- modules/node/node.module | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/node/node.module') diff --git a/modules/node/node.module b/modules/node/node.module index 6fde82264..bab68e652 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1151,6 +1151,20 @@ function node_menu($may_cache) { ); } } + // Error pages must to be present in the menu cache and be accessible to + // all. More often than not these are individual nodes. + for ($error_code = 403; $error_code <= 404; $error_code++) { + if (preg_match('|^node/(?P\d+)(?:/view)?$|', drupal_get_normal_path(variable_get('site_'. $error_code, '')), $matches) && ($node = node_load($matches['nid']))) { + $items[] = array( + 'path' => 'node/'. $node->nid, + 'title' => t('View'), + 'callback' => 'node_page_view', + 'callback arguments' => array($node), + 'access' => TRUE, + 'type' => MENU_CALLBACK, + ); + } + } } else { // Add the CSS for this module -- cgit v1.2.3