404 / 403 replacement feature doesn't work.
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3572545. --> Reported by: [rupertj](https://www.drupal.org/user/549944) Related to !13 >>> <p>From looking at the code in localgov_base_preprocess_page(), there's a couple of things wrong with the feature that replaces the page content for 404/403 pages.</p> <p>This is the code:</p> <pre>&nbsp;&nbsp;&nbsp; $is_404_page_node = $site_404 === 'node/' . $node_id;<br>&nbsp;&nbsp;&nbsp; $is_403_page_node = $site_403 === 'node/' . $node_id;<br>&nbsp;&nbsp;&nbsp; if ($is_404_page_node &amp;&amp; is_null($site_404)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $variables['default_status_content'] = TRUE;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $variables['default_status_content'] = FALSE;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; if ($is_403_page_node &amp;&amp; is_null($site_403)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $variables['default_status_content'] = TRUE;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $variables['default_status_content'] = FALSE;<br>&nbsp;&nbsp;&nbsp; }</pre><p>Firstly - the check for the 403 page will overwrite same variable as the check for the 404 page before it, making the check for the 404 page redundant.</p> <p>Secondly, the conditions in each check will always evaluate to false. IE: if $is_403_page_node is TRUE, because $site_403 === 'node/' . $node_id was TRUE, then is_null($site_403) cannot also be true, and the overall condition will evaluate to false, and $variables['default_status_content'] will always be set to FALSE. Twice.</p>
issue