-
-
Notifications
You must be signed in to change notification settings - Fork 594
[6.x] Ensure set preview images are updated when assets are renamed/replaced/deleted #13013
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
base: master
Are you sure you want to change the base?
Conversation
Because the facade calls cause issues with mocks in existing tests. Doing it this way avoids (as many) facade calls.
jasonvarga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I've done something silly, this doesn't seem to work at all. I can't get it to rename anything.
Plus, I think it might not work on a second level if you've defined statamic.assets.set_preview_images.folder as the path won't get saved in the blueprint - just the filename. We might need to change that.
When assets are deleted, the reference updater is called, which subsequently attempts to find the configured container for set preview images. However, the default container, `assets` doesn't exist, but if we don't mock it, the tests fail.
This pull request ensures that Set Preview Images on Bard & Replicator fields are updated when assets are renamed/replaced/deleted, like we do with content.
I've also added
Blueprint::all()which returns blueprints from all collections, taxonomies, etc.Closes #12680