-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Labels
plugin: multi-tenant@payloadcms/plugin-multi-tenant@payloadcms/plugin-multi-tenantstatus: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet
Description
Describe the Bug
When using the multi-tenant-plugin, uploading a media file with a filename that already exists under a different tenant triggers a validation error. The error occurs even though the filename is unique within the current tenant.
Expected behavior:
The media file should upload successfully since the filename is unique within the context of Tenant B.
Actual behavior:
A validation error is returned:
{
"errors": [
{
"name": "ValidationError",
"data": {
"errors": [
{
"message": "Value must be unique",
"path": "filename"
}
]
},
"message": "The following field is invalid: filename"
}
]
}
Notes:
The error seems to enforce global uniqueness rather than tenant-scoped uniqueness.
This issue prevents uploading files with the same name across different tenants.
Link to the code that reproduces this issue
Reproduction Steps
Set up multiple tenants using the multi-tenant-plugin.
Upload a media file (e.g., image.jpg) under Tenant A.
Switch to Tenant B and try to upload a media file with the same filename (image.jpg).
Which area(s) are affected?
plugin: multi-tenant
Environment Info
Payload version: 3.69.0
Metadata
Metadata
Assignees
Labels
plugin: multi-tenant@payloadcms/plugin-multi-tenant@payloadcms/plugin-multi-tenantstatus: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet