--- 2946333-9.2.x-255.patch 2021-11-03 11:41:07.000000000 +0100 +++ 2946333-224.patch 2021-11-02 09:09:13.000000000 +0100 @@ -27,7 +27,7 @@ + data-dialog-type: dialog + data-dialog-renderer: off_canvas diff --git a/core/modules/layout_builder/layout_builder.module b/core/modules/layout_builder/layout_builder.module -index 4553f0cada..10b34a321a 100644 +index cf1fcc9be6..f002fdc2d7 100644 --- a/core/modules/layout_builder/layout_builder.module +++ b/core/modules/layout_builder/layout_builder.module @@ -17,6 +17,7 @@ @@ -50,24 +50,23 @@ /** diff --git a/core/modules/layout_builder/layout_builder.post_update.php b/core/modules/layout_builder/layout_builder.post_update.php -index e40adb7342..f451a1355e 100644 +index 47d94aa52c..764480c193 100644 --- a/core/modules/layout_builder/layout_builder.post_update.php +++ b/core/modules/layout_builder/layout_builder.post_update.php -@@ -7,8 +7,10 @@ +@@ -5,6 +5,10 @@ + * Post update functions for Layout Builder. + */ - use Drupal\Core\Config\Entity\ConfigEntityUpdater; - use Drupal\Core\Entity\Display\EntityViewDisplayInterface; -- -+use Drupal\field\Entity\FieldConfig; +use Drupal\field\Entity\FieldStorageConfig; - use Drupal\layout_builder\Entity\LayoutEntityDisplayInterface; ++use Drupal\field\Entity\FieldConfig; +use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage; - ++ /** * Implements hook_removed_post_updates(). -@@ -67,3 +69,62 @@ function layout_builder_post_update_section_storage_context_mapping(&$sandbox = - - $config_entity_updater->update($sandbox, 'entity_view_display', $callback); + */ +@@ -34,3 +38,62 @@ function layout_builder_removed_post_updates() { + function layout_builder_post_update_override_entity_form_controller() { + // Empty post-update hook. } + +/** @@ -386,7 +385,7 @@ + +} diff --git a/core/modules/layout_builder/src/Element/LayoutBuilder.php b/core/modules/layout_builder/src/Element/LayoutBuilder.php -index 98923d7698..b46d8b9a54 100644 +index 0814604bbc..dd65f05aa1 100644 --- a/core/modules/layout_builder/src/Element/LayoutBuilder.php +++ b/core/modules/layout_builder/src/Element/LayoutBuilder.php @@ -2,7 +2,10 @@ @@ -407,7 +406,7 @@ +use Drupal\layout_builder\LayoutEntityHelperTrait; use Drupal\layout_builder\SectionStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; - use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; + use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -29,6 +33,7 @@ class LayoutBuilder extends RenderElement implements ContainerFactoryPluginInter use AjaxHelperTrait; use LayoutBuilderContextTrait; @@ -432,7 +431,7 @@ * @@ -48,11 +60,14 @@ class LayoutBuilder extends RenderElement implements ContainerFactoryPluginInter * The plugin implementation definition. - * @param \Symfony\Contracts\EventDispatcher\EventDispatcherInterface $event_dispatcher + * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher * The event dispatcher service. - * @param \Drupal\Core\Messenger\MessengerInterface|null $messenger - * The messenger service. This is no longer used and will be removed in @@ -510,16 +509,15 @@ return $output; } -@@ -234,6 +262,8 @@ protected function buildAdministrativeSection(SectionStorageInterface $section_s +@@ -233,6 +261,7 @@ protected function buildAdministrativeSection(SectionStorageInterface $section_s + $storage_id = $section_storage->getStorageId(); $section = $section_storage->getSection($delta); - $layout = $section->getLayout($this->getAvailableContexts($section_storage)); + $sections_editable = !static::isTranslation($section_storage); -+ $layout = $section->getLayout(); + $layout = $section->getLayout(); $layout_settings = $section->getLayoutSettings(); $section_label = !empty($layout_settings['label']) ? $layout_settings['label'] : $this->t('Section @section', ['@section' => $delta + 1]); - -@@ -244,33 +274,19 @@ protected function buildAdministrativeSection(SectionStorageInterface $section_s +@@ -244,33 +273,19 @@ protected function buildAdministrativeSection(SectionStorageInterface $section_s foreach ($layout_definition->getRegions() as $region => $info) { if (!empty($build[$region])) { foreach (Element::children($build[$region]) as $uuid) { @@ -558,7 +556,7 @@ // Add one to the current delta since it is zero-indexed. '#title' => $this->t('Add block in @section, @region region', ['@section' => $section_label, '@region' => $region_labels[$region]]), '#url' => Url::fromRoute('layout_builder.choose_block', -@@ -346,6 +362,7 @@ protected function buildAdministrativeSection(SectionStorageInterface $section_s +@@ -346,6 +361,7 @@ protected function buildAdministrativeSection(SectionStorageInterface $section_s ], 'remove' => [ '#type' => 'link', @@ -566,7 +564,7 @@ '#title' => $this->t('Remove @section', ['@section' => $section_label]), '#url' => Url::fromRoute('layout_builder.remove_section', [ 'section_storage_type' => $storage_type, -@@ -370,8 +387,8 @@ protected function buildAdministrativeSection(SectionStorageInterface $section_s +@@ -370,8 +386,8 @@ protected function buildAdministrativeSection(SectionStorageInterface $section_s ], 'configure' => [ '#type' => 'link', @@ -576,7 +574,7 @@ '#url' => Url::fromRoute('layout_builder.configure_section', [ 'section_storage_type' => $storage_type, 'section_storage' => $storage_id, -@@ -391,4 +408,67 @@ protected function buildAdministrativeSection(SectionStorageInterface $section_s +@@ -391,4 +407,67 @@ protected function buildAdministrativeSection(SectionStorageInterface $section_s ]; } @@ -692,7 +690,7 @@ /** diff --git a/core/modules/layout_builder/src/EventSubscriber/ComponentPluginTranslate.php b/core/modules/layout_builder/src/EventSubscriber/ComponentPluginTranslate.php new file mode 100644 -index 0000000000..5434fada26 +index 0000000000..ab1c38efe5 --- /dev/null +++ b/core/modules/layout_builder/src/EventSubscriber/ComponentPluginTranslate.php @@ -0,0 +1,93 @@ @@ -1031,7 +1029,7 @@ } diff --git a/core/modules/layout_builder/src/Form/TranslateBlockForm.php b/core/modules/layout_builder/src/Form/TranslateBlockForm.php new file mode 100644 -index 0000000000..9812a40e68 +index 0000000000..4fef961876 --- /dev/null +++ b/core/modules/layout_builder/src/Form/TranslateBlockForm.php @@ -0,0 +1,218 @@ @@ -1131,7 +1129,7 @@ + * An associative array containing the structure of the form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The current state of the form. -+ * @param \Drupal\layout_builder\TranslatableSectionStorageInterface $section_storage ++ * @param \Drupal\layout_builder\SectionStorageInterface $section_storage + * The section storage being configured. + * @param int $delta + * The delta of the section. @@ -1254,7 +1252,7 @@ + +} diff --git a/core/modules/layout_builder/src/InlineBlockEntityOperations.php b/core/modules/layout_builder/src/InlineBlockEntityOperations.php -index ad255cd6fe..92189b07d9 100644 +index 9760243bf3..291baaf7d3 100644 --- a/core/modules/layout_builder/src/InlineBlockEntityOperations.php +++ b/core/modules/layout_builder/src/InlineBlockEntityOperations.php @@ -2,6 +2,7 @@ @@ -1278,7 +1276,7 @@ - * general policy for constructor backwards compatibility is determined in - * https://www.drupal.org/node/3030640. + * @var \Drupal\Core\Block\BlockManagerInterface -+ */ ++ */ + protected $blockManager; + + /** @@ -1841,7 +1839,7 @@ 'enabled' => TRUE, 'allow_custom' => TRUE, diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php -index 9b650256b3..537a926e85 100644 +index 16c15993e6..37ee428db7 100644 --- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php +++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php @@ -2,16 +2,20 @@ @@ -2064,7 +2062,7 @@ } /** -@@ -167,25 +274,8 @@ protected function setUpEntities() { +@@ -165,25 +272,8 @@ protected function setUpEntities() { ->getStorage($this->entityTypeId); $storage->resetCache([$id]); $this->entity = $storage->load($id); @@ -2091,10 +2089,10 @@ $this->drupalLogin($this->translator); $add_translation_url = Url::fromRoute("entity.$this->entityTypeId.content_translation_add", [ $this->entityTypeId => $this->entity->id(), -@@ -194,31 +284,18 @@ protected function addEntityTranslation() { - ]); - $this->drupalGet($add_translation_url); - $this->submitForm(["{$this->fieldName}[0][value]" => 'The translated field value'], 'Save'); +@@ -193,31 +283,18 @@ protected function addEntityTranslation() { + $this->drupalPostForm($add_translation_url, [ + "{$this->fieldName}[0][value]" => 'The translated field value', + ], 'Save'); - $this->drupalLogin($user); } @@ -2573,7 +2571,7 @@ + +} diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php -index 2d14861143..1ec1876f5e 100644 +index 16e7640143..c674884b9c 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php @@ -17,6 +17,7 @@ @@ -2584,7 +2582,7 @@ /** * {@inheritdoc} -@@ -138,36 +139,6 @@ public function testFormsLinksDisabled() { +@@ -136,36 +137,6 @@ public function testFormsLinksDisabled() { $this->assertContextualLinksClickable(); }