craftcms / craftcms/cms

Unintended Asset folder creation

Open
#7,055 3 comments 0 reactions 1 assignee View on GitHub

@andris-sevcenko is already working on this.

Since Oct 28, 2020.

bug
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

Description

If you previously restricted assets to a single subfolder in a volume, e.g. volume1/subfolder1 and then changed the options so that (A) the user can upload to any volume and (B) it defaults to a different volume, and delete the original volume, it keeps getting recreated.

Steps to reproduce
  1. Restrict an asset field to a subfolder in a one volume, e.g. volume1/subfolder1
  2. Upload an asset
  3. Remove the restriction and default the selection to a different volume
  4. Delete all assets from volume1/subfolder1 and delete the folder itself
  5. Upload an asset to the other volume

The subfolder1 still gets created. Also, the /subfolder1 is still there as the singleUploadLocationSource in the project.yaml, whereas I think it should be null.

Additional info
  • Craft version: 3.5.14
  • PHP version: 7.4.11
  • Database driver & version: MySQL (10.5.5-MariaDB)
  • Plugins & versions: craftcms/aws-s3: 1.2.11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.