Skip to content

A locale does throw an 500 error, when showing a 404 page. #2004

@jonassiewertsen

Description

@jonassiewertsen

If you do work with localization and am having a locales selector in the header, everything does work great.

Should a 404 page been shown, with your header including locales, a 500 error will be thrown though.

How to Reproduce

  • Create a multisite
  • Create minimum 2 languages/sites
    Use something like this in your 404 layout:
{{ if site === 'default' }}
       {{ locales:da }}
             <a class="switch__link switch--language" href="{{ url }}">
                  {{ svg src="language" }}
               <span>DK</span>
             </a>
       {{ /locales:da }}
 {{ else }}
    ....
  • Visit a non existing page to get redirect to your 404 template

Environment

Statamic version: 3.0.0.-beta-33

PHP version: 7.4

Install method (choose one):

  • Fresh install from statamic/statamic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions