Open robdekort opened 12 months ago
This seems to be working for me on the latest version. Are you still seeing the issue Rob?
Yep
Here's a vid showing the issue. https://github.com/statamic/cms/assets/69107412/0e1f60fa-80b7-4e80-8af5-3b03c1445959
Can you share the global blueprint? Anything field combination I try works so I think it must be something to do with the blueprint.
Does the yaml in the global change? Or is it still a-peak.jpg?
Can you share the global blueprint? Anything field combination I try works so I think it must be something to do with the blueprint.
I just tested it with a basic blueprint. This one:
tabs:
general:
display: General
sections:
-
display: 'System pages'
instructions: 'Configure system pages.'
fields:
-
handle: assets_field
field:
mode: list
container: images
restrict: false
allow_uploads: true
show_filename: true
show_set_alt: true
type: assets
display: 'Assets Field'
icon: assets
listable: hidden
instructions_position: above
visibility: visible
replicator_preview: true
hide_display: false
Does the yaml in the global change? Or is it still a-peak.jpg?
It stays the same: a-peak.jpg
.
Ok, I've found why you can't replicate it. When I remove the GlobalSetSaved
event from the Peak Browser Appearance addon the asset does get replaced. So these things somehow seem to conflict.
You are finding all the fun race condition bugs. I think it's due to your Favicons::generate() looping over the globals and re-saving them.
I found if I change the line from:
Favicons::generate();
to
dispatch(fn () => Favicons::generate())->afterResponse();
It works fine. All that does it delay the generate function until after a response has been sent to the user's browser (and after all other processing).
Cool. That does fix the issue. I'll push that in an update. Thanks for diving in. I'll leave it up to Jason to decide if this should stay open.
Bug description
When you rename in assets, Statamic recursively goes to all entries to update any potential references in asset fields. However it doesn't seem to do this for globals.
How to reproduce
Add an asset field to a global Set an asset to your field Rename that asset Global asset field is now empty
Logs
No response
Environment
Installation
Starter Kit using via CLI
Antlers Parser
runtime (new)
Additional details
No response