Skip to content

SiteNotFoundException thrown on collection index after deleting a site #11796

@SteveEdson

Description

@SteveEdson

Bug description

When deleting a site, it doesn't delete the content, navigation, or trees. Statamic sees that the content exists, but can't find the deleted site, and triggering a SiteNotFoundException.

Now that sites are editable in the CMS rather than just config php, I'd expect users with privileged access to be able to remove old sites / languages without it breaking the entire CMS experience.

How to reproduce

  • Create a new site
  • Enable that site in the collection
  • Create a page on the new site
  • Create a navigation menu on the new site
  • Delete the old site
  • Browse to the collections page / frontend

Logs

Environment

Environment
Application Name: MELCloud
Laravel Version: 11.44.7
PHP Version: 8.3.20
Composer Version: 2.8.8
Environment: local
Debug Mode: ENABLED
URL: melcloud-world.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 4
Sites: 26 (United Kingdom / English, Belgium / Dutch, Belgium / French, and 23 more)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.55.0 PRO

Statamic Addons
alt-design/alt-redirect: 1.6.3
mitydigital/sitemapamic: 3.2.0
statamic/eloquent-driver: 4.21.1
statamic/ssg: 3.1.1

Statamic Eloquent Driver
Asset Containers: file
Assets: file
Blueprints: file
Collection Trees: file
Collections: file
Entries: file
Forms: file
Global Sets: file
Global Variables: file
Navigation Trees: file
Navigations: file
Revisions: file
Sites: file
Taxonomies: file
Terms: file
Tokens: file

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions