Skip to content

[3.x]: Unexpected behavior when an Asset field is using a volume that has been set as the "Temp Uploads Location" #11405

@angrybrad

Description

@angrybrad

What happened?

Steps to reproduce

  1. On a fresh Craft 3.7.44 install, create a local Asset volume.
  2. Go to Settings->Assets->Settings and select that volume as the "Temp Uploads Location"
  3. Go to Assets Index page and create a subfolder. Upload an image to that subfolder.
  4. Create an Assets field and add it to a section's field layout.
  5. Create a new entry, click the Asset field, and select the uploaded asset from the subfolder.
  6. Save the entry.
  7. Notice, on the Assets Index page, that the asset now lives in the root of the volume, not the subfolder.

Expected behavior

The asset should be in the subfolder.

Actual behavior

The asset is at the root of the volume.

Notes

This is likely a change in behavior caused by fa6fd63 that was released in 3.7.39.

Ideally, no one would select a volume that was intended to serve public assets, which mitigates this problem.

Things like the Asset field's source settings should remove any volumes so they can't be selected if "Temp Uploads Location" is set to a volume.

Craft CMS version

3.7.4.4

PHP version

7.4

Operating system and version

macOS

Database type and version

MariaDB 10

Image driver and version

imagick

Installed plugins and versions

None

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions