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.

Command icon 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

rupertj created an issue. See original summary.

rupertj’s picture

Issue summary: View changes
youngwolf0’s picture

I'm working on this.

markconroy’s picture

Status: Active » Needs review
markconroy’s picture

Status: Needs review » Reviewed & tested by the community

LGTM, thanks @youngwolf0

rupertj’s picture

Status: Reviewed & tested by the community » Needs work

The 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:

    $path = '/node/' . $node_id;

    if ($path === $site_403 || $path === $site_404) {
      $variables['default_status_content'] = FALSE;
    }