studio1902 / statamic-peak-seo

Belongs to the Statamic Peak Starter Kit and contains all SEO fieldsets and partials.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server 500 error instead of a 404 page

Aquive opened this issue · comments

Describe the bug
Server 500 error when visiting a page which does not exist. ([2023-07-04 13:11:26] production.ERROR: Attempt to read property "error_404_entry" on null {"userId":"c7c0e04f-4e33-4cb4-ac14-25e7aa5d325e","exception":"[object] (ErrorException(code: 0): Attempt to read property "error_404_entry" on null at /data/web/site/releases/16/vendor/studio1902/statamic-peak-seo/src/Handlers/ErrorPage.php:25)
)

To Reproduce
Steps to reproduce the behavior:

  1. Add new site to config/statamic/sites.php
  2. Go to a site which should thow a 404 page not found.
  3. See error

Expected behavior
Show nice 404 page

Additional context
"statamic/cms": "3.4.*",
"studio1902/statamic-peak-browser-appearance": "^1.0",
"studio1902/statamic-peak-commands": "^1.0",
"studio1902/statamic-peak-seo": "^1.0",
"studio1902/statamic-peak-tools": "^2.0"

Not a bug. Use php please multisite to add sites as per the docs, don't just add them to your sites.php. All should work as expected then.

@robdekort thanks for your reply. I already did that. And when I retry i get below message. Should I move some stuff manually when I add new sites after I ran multisite?

app@c8ecb4b5099e:~/application$ php please multisite
Already configured for multi-site.

Ok, that is not clear from your steps to reproduce. Can provide a thorough list of steps on how to reproduce this?

I am not sure exactly to be honest. I think I added a new site after I ran multisite. It is on development so I did lots of different things. What I see is that the "broken sites" do have a "page not found" entry in their respective folders, but the contents is empty apart from the internal id's and dates.

How does the system know which page to serve as a 404? I guess I need to check that...?

If I can't reproduce this I can't pinpoint any issue. But I don't see issues regarding 404's when following the documented multisite procedure.

I'm guessing something is off in your local install.

The content for your entries is empty because you haven't translated anything from the originating entry. It'll use the content from the origin entry until it's translated and saved.

Thanks for the fast support, as always ;)

Somehow in Globals > configuration there was a checkbox missing for the problematic site.

Thanks again!

Ah nice. You're welcome. Please use the Peak Discord for support though. I'm active there as well. I'd prefer this to be just a place for actual issues with the software.

Ah sure, no problem. I thought this was the best place for support!

Cool thanks. Nope this is for bugs and issue tracking.