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.
This is the code:
$is_404_page_node = $site_404 === 'node/' . $node_id;
$is_403_page_node = $site_403 === 'node/' . $node_id;
if ($is_404_page_node && is_null($site_404)) {
$variables['default_status_content'] = TRUE;
}
else {
$variables['default_status_content'] = FALSE;
}
if ($is_403_page_node && is_null($site_403)) {
$variables['default_status_content'] = TRUE;
}
else {
$variables['default_status_content'] = FALSE;
}
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.
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.
Issue fork localgov_base-3572545
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
rupertj commentedComment #3
youngwolf0 commentedI'm working on this.
Comment #5
markconroy commentedComment #6
markconroy commentedLGTM, thanks @youngwolf0
Comment #7
rupertj commentedThe code at the end is still hard to understand IMO. There's also some null checks that don't need to happen, as the type safe comparison with a string will catch them.
The code could be tidied into: