Skip to content

Returning MENU_NOT_FOUND does not always render a proper 404 page #3272

@quicksketch

Description

@quicksketch

Describe your issue or idea

In #100, we found a problem where returning MENU_NOT_FOUND in node_page_view() did not render a full 404 page with the title, layout, and blocks. Instead it only returned a page with nothing but the string "404".

Steps to reproduce

With the latest 1.x (or after 1.11.0 comes out), modify node_page_view() and replace the current page_not_found() call:

Replace:

  if ($type->settings['hidden_path'] && !$bypass_hidden_path) {
    backdrop_not_found();
    backdrop_exit();
  }

With:

  if ($type->settings['hidden_path'] && !$bypass_hidden_path) {
    return MENU_NOT_FOUND;
  }

Then disable path access to that content type and view as an anonymous user.

Actual behavior

You should get a fully themed 404 page.

Expected behavior

You get a page with nothing but "404" printed on it.

Relevant version/system information

Backdrop 1.11.0 (currently only Backdrop 1.x dev version).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions