πŸ‡¨πŸ‡¦Canada @ibullock

London, ON
Account created on 27 April 2011, about 13 years ago
#

Recent comments

πŸ‡¨πŸ‡¦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()));
    }
  }
}
Production build 0.69.0 2024