-
Notifications
You must be signed in to change notification settings - Fork 642
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
[5.x]: temp folders not deleting #16388
Comments
These are probably being created because you have an Assets field that is outputting I just added a |
Craft 4.14.0 and 5.6.0 are out with that new |
@brandonkelly unfortunately, I ran this command on the altest craft - utils/delete-empty-volume-folders It deleted about 650 folders that had images and videos. and left ONLY the empty volume folders. In effect, it completely destroyed the site and left just the thing I was trying to delete PHP version | 8.2.20 |
Oh no, I’m so sorry about that. I didn’t think to test with folders that were empty in terms of not having any assets directly in them, but had subfolders. It looks like that was the issue here, and Craft 5.6.1 is out now with a fix. |
Hi! That did NOT wipe everything this time. Thank you. There are still 35 empty folders that begin with "temp_" like "temp_aqjohrdcimamnobrewqkvplvakvlngvyaefh" in the root of the assets volume. Maybe its because the same long name also exists in projects/temp_aqjohrdcimamnobrewqkvplvakvlngvyaefh, for example? And inside projects/temp_aqjohrdcimamnobrewqkvplvakvlngvyaefh, for example, there are images? So the root folder has like "phantom folders" that connect to projects? The root temp_ folders are empty, wheras the same name temp_ folder in projects/ is not I'm using projects/{slug} in the path. I can't say for sure if they were created before slug was created. But you'd think after a slug is saved that temp_### folders would "automatically rename" to the right projects/{slug} folder. And it's still ongoing. So even if there is a project already saed, that has a slug, uploaded images are still getting put in the temp_ folders instead of projects/{slug}. It's becoming an issue because there are 800+ projects and they want to update them all ◡̈ Any ideas? |
Guessing those contain soft-deleted assets, so they are ignored by the command.
Yeah, at least maybe Assets fields can be updated to automatically delete the folder after it’s done moving assets around, if the folder is empty.
Do you have Otherwise, if you can tell me specific steps to reproduce, where you are seeing assets uploaded to a temp folder despite the entry definitely already having a slug, we can look into that further. |
Hi @brandonkelly Thanks! I'll zip the files and email support. I think it's how the {slug} variable works in nested entry types/matrix fields. It's like permanently stuck in temp_ |
Assets fields within Matrix fields will need to use |
Ok, I'm just going off this tip note: I did change the image and video paths in those fields all to "projects/{owner.slug}" instead of "projects/{slug}" and it still has the issue though.... I see some notes here.. but this is older and I have the same issue and don't see a resolution here |
Just testing this on my end and it’s working as expected. I created a Matrix field, with a selected entry type called “Image” that has an Assets field with the following settings:
I then created a new entry in a section that has the Matrix field, entered the title “Testing”, ensured the Slug field was filled in (“testing”), created an Image nested entry in the Matrix field, and uploaded an image to it. As expected, the image was immediately uploaded to a |
Thanks. Good to hear. Ok so maybe check out the video and site zip I sent to support today. Maybe it’s the way nested fields work? Or maybe it’s because it’s not required path but recommended default path?You will see the glitch im referring to in that video. Now, in the video I was still using the {slug} variable. But after I emailed you I updated to {owner.slug} and the same issue is there with temp_Thanks!On Jan 23, 2025, at 13:08, Brandon Kelly ***@***.***> wrote:
Just testing this on my end and it’s working as expected.
I created a Matrix field, with a selected entry type called “Image” that has an Assets field with the following settings:
Restrict assets to a single location: ✅
Asset Location: projects/{owner.slug}
I then created a new entry in a section that has the Matrix field, entered the title “Testing”, ensured the Slug field was filled in (“testing”), created an Image nested entry in the Matrix field, and uploaded an image to it. As expected, the image was immediately uploaded to a projects/testing subfolder, and no other subfolders exist in projects/.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@brandonkelly - ok it did have to do with nesting. We figured it out. Here's the note for others to see: From craft email support: What I think you need is projects/{{ object.getRootOwner().slug }} as the Default Upload Location. That will get the slug of the project, rather than the Matrix entries. I just tested that with your files, and it was placed in the correct folder (screenshot attached.) |
Ah, you must have 2+ layers of nesting then? |
Yes that's right. If you could forward this to your documentation team - that would be lovely! Not sure where this was written out. Thanks! |
What happened?
Description
I have several dozen temp folders that appear in the control panel -> Assets. They have names like temp_aqjohrdcimamnobrewqkvplvakvlngvyaefh.
These folders are empty of assets. Nothing is inside.
I want to delete them.
I do not know how to get rid of them in a batch way. If I try manually to check it and click delete, it works one by one. if i check more than one, the button to delete gets disabled. So I have to do them all manually.
Ideally this should not happen in the first place. Thoughts? Thanks!
Craft CMS version
5.5.8
PHP version
8.2.0
Operating system and version
Linux 5.15.49-linuxkit
Database type and version
MySQL 8.0.26
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions
Plugins
CKEditor 4.4.0
Cloner 3.0.1
Feed Me 6.6.1
Field Manager 4.0.3
The text was updated successfully, but these errors were encountered: