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> $is_404_page_node = $site_404 === 'node/' . $node_id;<br> $is_403_page_node = $site_403 === 'node/' . $node_id;<br> if ($is_404_page_node && is_null($site_404)) {<br> $variables['default_status_content'] = TRUE;<br> }<br> else {<br> $variables['default_status_content'] = FALSE;<br> }<br> if ($is_403_page_node && is_null($site_403)) {<br> $variables['default_status_content'] = TRUE;<br> }<br> else {<br> $variables['default_status_content'] = FALSE;<br> }</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