diff -u b/core/modules/block/src/Controller/BlockLibraryController.php b/core/modules/block/src/Controller/BlockLibraryController.php --- b/core/modules/block/src/Controller/BlockLibraryController.php +++ b/core/modules/block/src/Controller/BlockLibraryController.php @@ -104,8 +104,7 @@ $region = $request->query->get('region'); $weight = $request->query->get('weight'); - // Add url route parameters to provide correct region setting - // after creation. + // Add url route parameters to provide correct region setting after creation. $add_action_url = $build['local_actions']['block_content_add_action']['#link']['url'] ?? NULL; if ($add_action_url instanceof Url) { $add_action_url->setRouteParameter('region', $region); diff -u b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php --- b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php +++ b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php @@ -21,7 +21,7 @@ $options['query']['theme'] = $theme; } - // If the current request has a region query parameter. + // If the current request has a region, append it to the query string. if ($region = $this->request->query->get('region')) { $options['query']['region'] = $region; } diff -u b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php --- b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php +++ b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php @@ -70,7 +70,7 @@ } /** - * Tests that region value is retained when we create new block. + * Tests the region value when a new block is saved. */ public function testBlockRegionPlacement() { $this->drupalLogin($this->drupalCreateUser($this->permissions)); @@ -79,7 +79,7 @@ $this->clickLink('Add content block'); $this->assertSession()->statusCodeEquals(200); $edit = [ - 'info[0][value]' => $this->randomString(), + 'info[0][value]' => 'foo', ]; $this->submitForm($edit, 'Save'); $this->assertSession()->fieldValueEquals('region', 'help');