Open duncanmcclean opened 1 day ago
I discovered this while working on statamic/importer#47.
When you have a Files fieldtype, with max_files: 1, it allows you to upload multiple files, when it should only let you upload the one.
max_files: 1
https://github.com/user-attachments/assets/205aac40-16d0-43e7-8247-214ae8930974
- handle: file field: type: files max_files: 1
No response
Environment Application Name: Statamic Laravel Version: 11.30.0 PHP Version: 8.3.14 Composer Version: 2.8.3 Environment: local Debug Mode: ENABLED URL: importer-sandbox.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: sqlite Logs: stack / single Mail: log Queue: sync Session: file Statamic Addons: 1 Sites: 2 (Statamic, German) Stache Watcher: Enabled (auto) Static Caching: Disabled Version: 5.37.0 PRO Statamic Addons statamic/importer: 1.4.1
Fresh statamic/statamic site via CLI
As a workaround, you can add a max: 1 validation rule to ensure only 1 file can actually be uploaded.
max: 1
Bug description
I discovered this while working on statamic/importer#47.
When you have a Files fieldtype, with
max_files: 1
, it allows you to upload multiple files, when it should only let you upload the one.https://github.com/user-attachments/assets/205aac40-16d0-43e7-8247-214ae8930974
How to reproduce
max_files: 1
(it's a hidden fieldtype, so you'll need to add it to your blueprint manually):Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response