You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defining simple callback based event listeners in EventServiceProvider break the AssetReferenceUpdater, e.g.
app/Providers/EventServiceProvider.php
public function boot()
{
// Adding this breaks asset moving
// "Undefined array key listener"
Event::listen(function (EntrySaved $event) {
\Log::info('EntrySaved. Handle: ' . $event->entry->collectionHandle());
});
}
If you add the above code then:
Add an asset to an entry
Move / rename that asset
You will see the "Undefined array key listener" error.
The asset will in fact be moved but any entry reference updates will fail.
The strange thing is that using a Listener class instead of a callback works fine.
It seems that a few different entry / nav events are causing this behaviour (not just EntrySaved)
Bug description
Defining simple callback based event listeners in EventServiceProvider break the AssetReferenceUpdater, e.g.
app/Providers/EventServiceProvider.php
If you add the above code then:
The strange thing is that using a Listener class instead of a callback works fine.
It seems that a few different entry / nav events are causing this behaviour (not just EntrySaved)
I have made a repo to demonstrate this:
https://github.com/stuartcusackie/stateventtest
How to reproduce
Download this repo and follow the instructions in README:
https://github.com/stuartcusackie/stateventtest
Logs
...
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
No response
The text was updated successfully, but these errors were encountered: