diff core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
line wrap: on
line diff
--- a/core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php	Thu May 09 15:34:47 2019 +0100
@@ -9,19 +9,10 @@
 
 /**
  * Provides AJAX responses to rebuild the Layout Builder.
- *
- * @internal
  */
 trait LayoutRebuildTrait {
 
   /**
-   * The class resolver.
-   *
-   * @var \Drupal\Core\DependencyInjection\ClassResolverInterface
-   */
-  protected $classResolver;
-
-  /**
    * Rebuilds the layout.
    *
    * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
@@ -49,8 +40,10 @@
    */
   protected function rebuildLayout(SectionStorageInterface $section_storage) {
     $response = new AjaxResponse();
-    $layout_controller = $this->classResolver->getInstanceFromDefinition(LayoutBuilderController::class);
-    $layout = $layout_controller->layout($section_storage, TRUE);
+    $layout = [
+      '#type' => 'layout_builder',
+      '#section_storage' => $section_storage,
+    ];
     $response->addCommand(new ReplaceCommand('#layout-builder', $layout));
     return $response;
   }