Bug description
I have developed a private addon for one of our websites and noticed that the EntrySaved event is triggered twice.
This means that listeners that listen to the event are also executed twice. But this should not happen! Especially if third-party systems etc. are still influenced by this.
How to reproduce
You can easily reproduce this: Just register a Laravel event listener on the event and then write a log to the handle() method.
Alternatively, you can also reproduce the duplicate event via Telescope.
Logs
No response
Environment
EnvironmentApplication Name: Konkav & K16Laravel Version: 10.39.0PHP Version: 8.2.14Composer Version: 2.5.5Environment: localDebug Mode: ENABLEDURL: k16-konkav-cms.testMaintenance Mode: OFFCacheConfig: NOT CACHEDEvents: NOT CACHEDRoutes: NOT CACHEDViews: CACHEDDriversBroadcasting: logCache: statamicDatabase: mysqlLogs: stack / singleMail: smtpQueue: redisSession: fileStatamicAddons: 8Antlers: runtimeStache Watcher: EnabledStatic Caching: DisabledVersion: 4.42.0 PROStatamic Addonsaryehraber/statamic-uuid: 2.2.0jonassiewertsen/statamic-documentation: 1.9.0morethingsdigital/personio: dev-mainmorethingsdigital/statamic-nextjs: dev-mainstudio1902/statamic-peak-browser-appearance: 3.3.4studio1902/statamic-peak-commands: 2.7.0studio1902/statamic-peak-seo: 5.0studio1902/statamic-peak-tools: 3.4.3
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
Possibly the reason:
After initial research, I was able to trace it back to the CollectionTree being updated/saved after the entry was updated/saved. However, the CollectionTree then saves the entry again and this leads to the second event.
I think that saving the entry in the CollectionTree should take place unnoticed.
Bug description
I have developed a private addon for one of our websites and noticed that the EntrySaved event is triggered twice.
This means that listeners that listen to the event are also executed twice. But this should not happen! Especially if third-party systems etc. are still influenced by this.
How to reproduce
You can easily reproduce this: Just register a Laravel event listener on the event and then write a log to the handle() method.
Alternatively, you can also reproduce the duplicate event via Telescope.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
Possibly the reason:
After initial research, I was able to trace it back to the CollectionTree being updated/saved after the entry was updated/saved. However, the CollectionTree then saves the entry again and this leads to the second event.
I think that saving the entry in the CollectionTree should take place unnoticed.