Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.146 diff -u -r1.146 system.admin.inc --- modules/system/system.admin.inc 16 May 2009 20:10:50 -0000 1.146 +++ modules/system/system.admin.inc 19 May 2009 04:26:15 -0000 @@ -1228,6 +1228,12 @@ '#description' => t('This page is displayed when no other content matches the requested document. If unsure, specify nothing.'), '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=') ); + $form['site_error_show_blocks'] = array( + '#type' => 'checkbox', + '#title' => t('Display blocks on 403/404 pages'), + '#default_value' => '', + '#description' => t('When enabled, will show the blocks on the not found/access denied pages. Take caution, as this can effect the performance of your site.'), + ); $form['#validate'][] = 'system_site_information_settings_validate'; return system_settings_form($form); Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.904 diff -u -r1.904 common.inc --- includes/common.inc 16 May 2009 19:58:38 -0000 1.904 +++ includes/common.inc 19 May 2009 04:26:14 -0000 @@ -370,13 +370,18 @@ // Standard 404 handler. drupal_set_title(t('Page not found')); $return = t('The requested page could not be found.'); - } - $page = drupal_get_page($return); - // To conserve CPU and bandwidth, omit the blocks. - $page['#show_blocks'] = FALSE; + // Show the blocks from the front page if desired. + if (variable_get('site_error_show_blocks')) { + menu_set_active_item(variable_get('site_frontpage', 'node')); + } + } + else { + // The menu path was a success. Remove the blocks if desired to conserve CPU. + $return['#show_blocks'] = variable_get('site_error_show_blocks'); + } - print drupal_render_page($page); + print drupal_render_page($return); } /** @@ -399,6 +404,15 @@ // Standard 403 handler. drupal_set_title(t('Access denied')); $return = t('You are not authorized to access this page.'); + + // Show the blocks from the front page if desired. + if (variable_get('site_error_show_blocks')) { + menu_set_active_item(variable_get('site_frontpage', 'node')); + } + } + else { + // The menu path was a success. Remove the blocks if desired to conserve CPU. + $return['#show_blocks'] = variable_get('site_error_show_blocks'); } print drupal_render_page($return);