summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/Render/BubbleableMetadata.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/lib/Drupal/Core/Render/BubbleableMetadata.php')
-rw-r--r--core/lib/Drupal/Core/Render/BubbleableMetadata.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/lib/Drupal/Core/Render/BubbleableMetadata.php b/core/lib/Drupal/Core/Render/BubbleableMetadata.php
index 81e7237..a8a71d7 100644
--- a/core/lib/Drupal/Core/Render/BubbleableMetadata.php
+++ b/core/lib/Drupal/Core/Render/BubbleableMetadata.php
@@ -95,6 +95,19 @@ class BubbleableMetadata extends CacheableMetadata implements AttachmentsInterfa
}
/**
+ * {@inheritdoc}
+ */
+ public function addCacheableDependency($other_object) {
+ parent::addCacheableDependency($other_object);
+
+ if ($other_object instanceof AttachmentsInterface) {
+ $this->addAttachments($other_object->getAttachments());
+ }
+
+ return $this;
+ }
+
+ /**
* Merges two attachments arrays (which live under the '#attached' key).
*
* The values under the 'drupalSettings' key are merged in a special way, to