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]: Asset index after emptying folder via FTP #12585

Closed
mark-chief opened this issue Jan 27, 2023 · 7 comments
Closed

[4.x]: Asset index after emptying folder via FTP #12585

mark-chief opened this issue Jan 27, 2023 · 7 comments
Assignees

Comments

@mark-chief
Copy link

What happened?

Description

Back in Craft 3, when you deleted an Asset volume folder on the server, you could go to utilities and update the Asset Index and it would update the volume in the CP.

But in Craft 4, after you delete all assets from a volume via FTP and then go to Utlities > Asset Index > Update asset index, it says there's nothing to index and the volume still shows all the assets as broken images as they obviously dont exist.

Craft CMS version

4.3.6.1

PHP version

8.1

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 Jan 27, 2023

Hi, thanks for getting in touch. This is an expected behaviour in Craft 4. It will only occur if there's absolutely nothing (no files and no folders) under the base path of the filesystem used by the volume you're indexing. That being said, we are going to make the message clearer in 4.4.

@mark-chief
Copy link
Author

mark-chief commented Jan 27, 2023

Thanks for checking. So even though all the empty subfolders dont exist on the server, you still have to manually delete all of them via the craft CP?

Seems counterintuitive, unless I have missed something completely obvious or misunderstood.

E.g. These folders do not exist on the server anymore as deleted via FTP, and updating the Asset Index doesn't pick that up?
Screenshot 2023-01-27 at 16 33 54

@i-just
Copy link
Contributor

i-just commented Jan 27, 2023

Ok, I understand what you're after a bit better now.

Yes, that's correct - at the moment, you'd have to delete them manually. Though it's not so much that the Asset Index doesn't pick it up; it's that it's not getting that far if there's absolutely nothing under your FS base path.

You can "bypass" that if you have even one empty folder under your FS base path location.

We'll talk about this behaviour internally, and I'll update this issue once we've done that.

@mark-chief
Copy link
Author

Thank you

@i-just
Copy link
Contributor

i-just commented Feb 2, 2023

We’ve discussed this, and I created a PR to change the current behaviour so that a list of missing files and folders is shown even if there’s nothing in the FS root folder.

@brandonkelly
Copy link
Member

This is resolved for Craft 4.4 via #12604 🎉

@brandonkelly
Copy link
Member

4.4 is out now!

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

3 participants