π¨π¦Canada ibullock London, ON
DamienMcKenna β credited ibullock β .
π¨π¦Canada ibullock London, ON
Re-rolling patch for 2.1
π¨π¦Canada ibullock London, ON
ibullock β made their first commit to this issueβs fork.
π¨π¦Canada ibullock London, ON
ibullock β made their first commit to this issueβs fork.
π¨π¦Canada ibullock London, ON
+1 RTBC - Would be nice to get a release
π¨π¦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()));
}
}
}