Open mrcalc opened 3 months ago
Thanks for this, I'll look this week.
Sorry for the delay but I can't reproduce this.
What versions of things are you using? Can you please post the output of php please support:details
?
Thanks. See Context (Environment) above for support details. I will check that it's not caused by other code on the site.
See Context (Environment) above for support details
Sigh, I could learn to read.
Current Behavior
Viewing spam submissions in the queue gives a 404 error (Page not found) http://localhost/cp/akismet/queues/contact_us/spam/1721962338.9203
Expected Behavior
Viewing spam submissions in the queue shows the submission.
Possible Solution
This issue seems to be an incompatibility between route binding for
{id}
and Statamic's use of microtime for IDs.Spam submissions are stored with the filename created from
microtime(true)
which contains a dot e.g.1721962338.9203.yaml
.When this is used in a route with '{id}' it doesn't match id in the route
Route::get('{id}', [ShowSpamController::class, '__invoke'])->name('show');
and falls through to the CpController pageNotFound method.If it is working for other sites, this may be an incompatibility with the environment (see below).
Statamic form submission routes bind on
$submission
- seeStatamic\Http\Controllers\CP\Forms\FormSubmissionsController::show
It seems to work if the route binding uses
{submission}
instead of{id}
. This needs more testing.Steps to Reproduce
storage/app/spam/contact_us
for new spam submission with the filename based on the microtime of the submission e.g.1721962338.9203.yaml
.ShowSpamController __invoke
is not hit.Context (Environment)
Environment Application Name: Test Laravel Version: 10.48.15 PHP Version: 8.2.14 Composer Version: 2.6.6 Environment: local Debug Mode: ENABLED URL: localhost Maintenance Mode: OFF
Cache Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: CACHED
Drivers Broadcasting: null Cache: file Database: mysql Logs: stack / daily Mail: smtp Queue: database Session: file
Statamic Addons: 4 Sites: 2 (Test1, Test2) Stache Watcher: Enabled Static Caching: Disabled Version: 5.17.0 PRO
Statamic Addons edalzell/forma: 3.0.1 silentz/akismet: 5.0 stoffelio/statamic-turnstile: 1.2.1 studio1902/statamic-peak-seo: 8.15.3