I've tried #22 and it seems to work well for my use case at least (Adding to CSP domains list)
We've started running into similar problems with other forms and this seems to be related to Site Studio or the theme in place so I'm closing this.
ibullock β created an issue.
I got here looking for this exact feature. Would be particularly useful for Site Factory installs where the term IDs may not be consistent for each new site.
+1 for RTBC, been using in the wild for a few months now without issue.
DamienMcKenna β credited ibullock β .
Re-rolling patch for 2.1
ibullock β made their first commit to this issueβs fork.
ibullock β made their first commit to this issueβs fork.
+1 RTBC - Would be nice to get a release
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()));
}
}
}