Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Temporary folders are being created when using {slug} in Asset field #13311

Closed
jimirobaer opened this issue Jun 13, 2023 · 5 comments
Closed
Assignees

Comments

@jimirobaer
Copy link

What happened?

Description

Folders are being created when a new entry containing an Asset field, that has been configured to use the {slug} as the Default Upload Location, is created.

The folders are named after the draft, ex. temp_sftzbaeqedinubfrccouaofyfyyintwesbod. These folders are automatically created, even before an asset is uploaded on the field. The field just needs to be present on the entry type.

Steps to reproduce

  1. Create an Asset field and add {slug} to the Default Upload Location.
  2. Add the field to an entry type which has drafts enabled.
  3. Create a new entry using the entry type.

Expected behavior

No folders linked to the draft to be created on each new entry.

Actual behavior

Folders linked to the draft being created on each new entry.

Screenshot 2023-06-13 at 14 46 52

Craft CMS version

4.4.13

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@i-just
Copy link
Contributor

i-just commented Jun 14, 2023

Hi, thanks for reporting! I raised a PR for this.

@brandonkelly
Copy link
Member

Craft 4.4.15 is out with a fix for this. Thanks again for reporting!

@sandrodunkel
Copy link

Since this fix, Default Upload Location does not seem to work for me anymore. Does not work with a dynamic path (e.g. {slug} or {section}) and does not work with a fixed path (e.g. "/pages"). Worked perfectly on Craft 4.4.12.

image

@i-just
Copy link
Contributor

i-just commented Jul 21, 2023

@sandrodunkel, I just did a quick test and the “Default Upload Location” works as expected when uploading directly into an assets field (via the “Upload files” button).
Screenshot 2023-07-21 at 13 36 26

When using the “Add an asset” button, the user can choose the location to upload to (within what’s allowed by the field).

@sandrodunkel
Copy link

You're right—my bad. Thanks @i-just

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants