diff --git a/core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsTrait.php b/core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsTrait.php index 6e5294c..319e3a4 100644 --- a/core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsTrait.php +++ b/core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsTrait.php @@ -33,10 +33,9 @@ * HTML rendered content. */ protected function getRenderedContent() { - $this->attachedAssets = new AttachedAssets(); if (is_array($this->content)) { $html = \Drupal::service('renderer')->render($this->content); - $this->attachedAssets->createFromRenderArray($this->content); + $this->attachedAssets = AttachedAssets::createFromRenderArray($this->content); return $html; } else {