diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php index 4f139f3..b1724ed 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php @@ -68,16 +68,19 @@ public function __construct(PluginManagerInterface $entity_manager, EntityStorag /** * Displays add custom block links for available types. * + * @param \Symfony\Component\HttpFoundation\Request $request + * The current request object. + * * @return array * A render array for a list of the custom block types that can be added or * if there is only one custom block type defined for the site, the function * returns the custom block add page for that custom block type. */ - public function add() { + public function add(Request $request) { $types = $this->customBlockTypeStorage->load(); if ($types && count($types) == 1) { $type = reset($types); - return $this->addForm($type); + return $this->addForm($type, $request); } return array('#theme' => 'custom_block_add_list', '#content' => $types); @@ -108,7 +111,7 @@ public function addForm(CustomBlockTypeInterface $custom_block_type, Request $re // newly created block in the given theme. $block->setTheme($theme); } - return $this->entityManager->getForm($block); + return $this->entityManager->getForm($block, 'add'); } }