Skip to content

Conversation

@simonerd
Copy link
Contributor

@simonerd simonerd commented Sep 4, 2025

We're currently exploring ways to build an asset index that tracks asset usage throughout the cms, to make updating references more performant in a system with a large amount of entries. In a lot of ways the current structure makes that very easy by overwriting/extending some parts of the UpdateAssetReferences subscriber.

However, when replacing an asset, the Asset class temporarily disables the Subscriber to not react to the AssetDeleted event, if the "delete old asset"-option is enabled. Unfortunately this doesn't affect my custom class, that I've bound in a service provider.

So, this PR simply changes these enable() and disable() calls to use the service container 😇

If you have any other ideas/suggestions on how to solve this instead, I'm happy for any input.

@jasonvarga jasonvarga merged commit fd9bf1f into statamic:5.x Sep 4, 2025
26 checks passed
@simonerd simonerd deleted the make-update-asset-references-overwritable branch September 4, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants