Skip to content

Files Fieldtype: max_files: 1 doesn't prevent uploading more than 1 file #11197

Open
@duncanmcclean

Description

@duncanmcclean

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.

CleanShot.2024-11-29.at.11.42.09.mp4

How to reproduce

  1. Add a Files fieldtype with max_files: 1 (it's a hidden fieldtype, so you'll need to add it to your blueprint manually):
-
  handle: file
  field:
    type: files
    max_files: 1

Logs

No response

Environment

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

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions