diff --git a/core/modules/block_content/config/schema/block_content.schema.yml b/core/modules/block_content/config/schema/block_content.schema.yml index a9aeeac..2e7c338 100644 --- a/core/modules/block_content/config/schema/block_content.schema.yml +++ b/core/modules/block_content/config/schema/block_content.schema.yml @@ -16,15 +16,3 @@ block_content.type.*: description: type: text label: 'Description' - -block.settings.block_content:*: - type: block_settings - label: 'Block content' - mapping: - block_content: - type: mapping - label: 'Block content settings' - mapping: - view_mode: - type: string - label: 'View Mode' diff --git a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php index 9e40c81..8e861d2 100644 --- a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php +++ b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php @@ -122,7 +122,7 @@ public function defaultConfiguration() { * Adds body and description fields to the block configuration form. */ public function blockForm($form, FormStateInterface $form_state) { - $form['block_content']['view_mode'] = array( + $form['view_mode'] = array( '#type' => 'select', '#options' => $this->entityManager->getViewModeOptions('block_content'), '#title' => t('View mode'), @@ -139,7 +139,7 @@ public function blockForm($form, FormStateInterface $form_state) { public function blockSubmit($form, FormStateInterface $form_state) { // Invalidate the block cache to update custom block-based derivatives. if ($this->moduleHandler->moduleExists('block')) { - $this->configuration['view_mode'] = $form_state->getValue(array('block_content', 'view_mode')); + $this->configuration['view_mode'] = $form_state->getValue('view_mode'); $this->blockManager->clearCachedDefinitions(); } } diff --git a/core/modules/block_content/src/Tests/BlockContentCreationTest.php b/core/modules/block_content/src/Tests/BlockContentCreationTest.php index 93704cd..1c1dacc 100644 --- a/core/modules/block_content/src/Tests/BlockContentCreationTest.php +++ b/core/modules/block_content/src/Tests/BlockContentCreationTest.php @@ -63,12 +63,12 @@ public function testBlockContentCreation() { )), 'Basic block created.'); // Change the view mode. - $view_mode['settings[block_content][view_mode]'] = 'test_view_mode'; + $view_mode['settings[view_mode]'] = 'test_view_mode'; $this->drupalPostForm(NULL, $view_mode, t('Save block')); // Go to the configure page and verify that the new view mode is correct. $this->drupalGet('admin/structure/block/manage/testblock'); - $this->assertFieldByXPath('//select[@name="settings[block_content][view_mode]"]/option[@selected="selected"]/@value', 'test_view_mode', 'View mode changed to Test View Mode'); + $this->assertFieldByXPath('//select[@name="settings[view_mode]"]/option[@selected="selected"]/@value', 'test_view_mode', 'View mode changed to Test View Mode'); // Test the available view mode options. $this->assertOption('edit-settings-block-content-view-mode', 'default', 'The default view mode is available.'); diff --git a/core/modules/block_content/tests/modules/block_content_test/config/install/block.block.foobargorilla.yml b/core/modules/block_content/tests/modules/block_content_test/config/install/block.block.foobargorilla.yml index 10b2993..b8b7827 100644 --- a/core/modules/block_content/tests/modules/block_content_test/config/install/block.block.foobargorilla.yml +++ b/core/modules/block_content/tests/modules/block_content_test/config/install/block.block.foobargorilla.yml @@ -27,5 +27,3 @@ settings: status: true info: '' view_mode: default - block_content: - view_mode: default