- πΊπΈUnited States jennypanighetti
I'm running into this same issue. Any advice on how you wrote your hook to clear it??
-Jenny
- π¨π¦Canada ibullock London, ON
Hi Jenny - Here's a look at what we ended up implementing. It actually changed a little since I created this issue so that we could include nested bricks in the cache invalidation. You'll need to change the field machine name at the very least, but hopefully it helps!
/** * Implements hook_entity_presave(). */ function mymodule_components_entity_presave(Drupal\Core\Entity\EntityInterface $entity) { if ($entity->getEntityType()->id() == 'node' && $entity->field_components !== NULL) { $bricks = $entity->field_components->referencedEntities(); foreach ($bricks as $brick) { Cache::invalidateTags(array('brick:' . $brick->id())); } } }