diff core/modules/layout_builder/src/Controller/ChooseSectionController.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children 12f9dff5fda9
line wrap: on
line diff
--- a/core/modules/layout_builder/src/Controller/ChooseSectionController.php	Thu Feb 28 11:14:44 2019 +0000
+++ b/core/modules/layout_builder/src/Controller/ChooseSectionController.php	Thu Feb 28 13:11:55 2019 +0000
@@ -2,6 +2,7 @@
 
 namespace Drupal\layout_builder\Controller;
 
+use Drupal\Core\Ajax\AjaxHelperTrait;
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\Core\Layout\LayoutPluginManagerInterface;
 use Drupal\Core\Plugin\PluginFormInterface;
@@ -61,7 +62,8 @@
     $output['#title'] = $this->t('Choose a layout');
 
     $items = [];
-    foreach ($this->layoutManager->getDefinitions() as $plugin_id => $definition) {
+    $definitions = $this->layoutManager->getFilteredDefinitions('layout_builder', [], ['section_storage' => $section_storage]);
+    foreach ($definitions as $plugin_id => $definition) {
       $layout = $this->layoutManager->createInstance($plugin_id);
       $item = [
         '#type' => 'link',