Bug description
When changing the slug on a statamic entry the old html file does not get removed from the file system and remains in cache.
This causes the redirect from the old page to not function and still show the page before the slug change.
How to reproduce
- Enable fullpage static cache
- Create a new page entry with e.g. the name
test
- Save the page, visit the page and ensure the .html file is created.
- Rename the slug to test2
- Save the page, visit the page and ensure the .html file is created.
To verify the bug:
- Try to visit the old
test slug page, see if it redirects. Which it won't if the bug exists
- Check if the test_.html file exists. Which it will if the bug exists.
Logs
Environment
Environment
Laravel Version: 13.13.0
PHP Version: 8.4.22
Composer Version: 2.10.1
Environment: production
Debug Mode: OFF
Maintenance Mode: OFF
Timezone: UTC
Locale: nl
Cache
Config: NOT CACHED
Events: CACHED
Routes: CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: daily
Mail: smtp
Queue: sync
Session: file
Storage
public/storage: LINKED
Statamic
Stache Watcher: Disabled (auto)
Static Caching: full
Version: 6.20.1 PRO
Statamic Addons
just-better/statamic-authentik: 2.0.0
justbetter/statamic-cloudflare-purge: 2.0.0
justbetter/statamic-detour: 0.5.0
justbetter/statamic-download-center: dev-master
justbetter/statamic-glide-directive: 4.1.0
justbetter/statamic-image-optimize: 5.2.0
justbetter/statamic-veto: 0.3.0
statamic-rad-pack/runway: 9.4.5
statamic/eloquent-driver: 5.9.0
tdwesten/statamic-builder: 3.0.9
Statamic Eloquent Driver
Addon Settings: file
Asset Containers: file
Assets: eloquent
Blueprints: file
Collection Trees: eloquent
Collections: file
Entries: eloquent
Fieldsets: file
Form Submissions: eloquent
Forms: eloquent
Global Sets: eloquent
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: file
Revisions: file
Sites: file
Taxonomies: file
Terms: eloquent
Tokens: eloquent
Installation
Existing Laravel app
Additional details
Perhaps we need a dedicated save observer checking for slug changes, and passing the old slug to the invalidator instead of the usual method of passing the current slug
Bug description
When changing the slug on a statamic entry the old html file does not get removed from the file system and remains in cache.
This causes the redirect from the old page to not function and still show the page before the slug change.
How to reproduce
testTo verify the bug:
testslug page, see if it redirects. Which it won't if the bug existsLogs
Environment
Installation
Existing Laravel app
Additional details
Perhaps we need a dedicated save observer checking for slug changes, and passing the old slug to the invalidator instead of the usual method of passing the current slug