craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.28k stars 635 forks source link

[4.x]: Assets: Dynamic Subfolder Paths not Working #11363

Closed maxfrischknecht closed 2 years ago

maxfrischknecht commented 2 years ago

What happened?

Description

I followed the docs to create dynamic subfolder paths for an asset field.

Steps to reproduce

  1. Create an asset field
  2. Create a dynamic subfolder like shown in the screenshot below

Bildschirmfoto 2022-06-01 um 10 26 09

Expected behavior

Upload the image under images/news/slug/test.jpg.

Actual behavior

Uploades the image to images/test.jpg (see screenshot below).

Bildschirmfoto 2022-06-01 um 10 27 57

Craft CMS version

4.0.3

PHP version

8.1.5

Operating system and version

Linux 3.10.0-962.3.2.lve1.5.52.el7.x86_64

Database type and version

MySQL 5.7.37

Image driver and version

Imagick 3.5.1 (ImageMagick 7.1.0-2)

Installed plugins and versions

brandonkelly commented 2 years ago

How exactly are you uploading the images? The “Default Upload Location” will only be used when you are dragging a file onto the Assets field, or pressing the “Upload files” button beside “Add an asset”. If you upload a file within the asset selection modal, it will be uploaded to the currently-selected location.

maxfrischknecht commented 2 years ago

Sorry for not clarifying this earlier, I was uploading the images by clicking "+ Add an asset" and then drag & drop them into the popup dialogue. I understood this as the "field", but when I upload it directly into the field or with "Upload Files" it works.

Thank you for the support!