diff --git a/core/modules/layout_builder/src/Form/BlockPluginTranslationFormTrait.php b/core/modules/layout_builder/src/Form/BlockPluginTranslationFormTrait.php deleted file mode 100644 index 631ac904ce..0000000000 --- a/core/modules/layout_builder/src/Form/BlockPluginTranslationFormTrait.php +++ /dev/null @@ -1,38 +0,0 @@ -plugin instanceof ConfigurableInterface) { - $configuration = $this->plugin->getConfiguration(); - $form['label'] = [ - '#title' => $this->t('Label'), - '#type' => 'textfield', - '#default_value' => isset($this->translatedConfiguration['label']) ? $this->translatedConfiguration['label'] : $configuration['label'], - '#required' => TRUE, - ]; - } - return $form; - } - - /** - * {@inheritdoc} - */ - public function setTranslatedConfiguration(array $translated_configuration) { - $this->translatedConfiguration = $translated_configuration; - } - -} diff --git a/core/modules/layout_builder/src/Plugin/Block/InlineBlock.php b/core/modules/layout_builder/src/Plugin/Block/InlineBlock.php index e75d9dd48f..08c300fe5f 100644 --- a/core/modules/layout_builder/src/Plugin/Block/InlineBlock.php +++ b/core/modules/layout_builder/src/Plugin/Block/InlineBlock.php @@ -150,7 +150,7 @@ public function defaultConfiguration() { */ public function blockForm($form, FormStateInterface $form_state) { $block = $this->getEntity(); - if (!$this->isNew) { + if (!$this->isNew && !$block->isNew()) { // Get the active block for editing purposes. $block = $this->entityRepository->getActive('block_content', $block->id()); } diff --git a/core/modules/layout_builder/tests/src/Functional/TranslationTestTrait.php b/core/modules/layout_builder/tests/src/Functional/TranslationTestTrait.php index b78025b0f1..4fdbf46247 100644 --- a/core/modules/layout_builder/tests/src/Functional/TranslationTestTrait.php +++ b/core/modules/layout_builder/tests/src/Functional/TranslationTestTrait.php @@ -15,7 +15,7 @@ protected function assertNonTranslationActionsRemoved() { $assert_session = $this->assertSession(); // Confirm that links do not exist to change the layout. $assert_session->linkNotExists('Add Section'); - $assert_session->linkNotExists('Add Block'); + $assert_session->linkNotExists('Add block'); $assert_session->linkNotExists('Remove section'); $assert_session->elementNotExists('css', '[data-contextual-id^="layout_builder_block:"]'); } diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php index 763d7b3ea8..237d9ebfee 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php @@ -24,8 +24,8 @@ protected function addBlock($block_link_text, $rendered_locator, $label_display $page = $this->getSession()->getPage(); // Add a new block. - $this->assertNotEmpty($assert_session->waitForElementVisible('css', '#layout-builder a:contains(\'Add Block\')')); - $this->clickLink('Add Block'); + $this->assertNotEmpty($assert_session->waitForElementVisible('css', '#layout-builder a:contains(\'Add block\')')); + $this->clickLink('Add block'); $this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas')); $assert_session->assertWaitOnAjaxRequest(); @@ -41,7 +41,7 @@ protected function addBlock($block_link_text, $rendered_locator, $label_display if ($label !== NULL) { $page->fillField('settings[label]', $label); } - $page->pressButton('Add Block'); + $page->pressButton('Add block'); // Wait for block form to be rendered in the Layout Builder. $this->assertNotEmpty($assert_session->waitForElement('css', $rendered_locator));