From b8653333e7fff132e45cb72748cf4a905d6ef910 Mon Sep 17 00:00:00 2001
From: Liam Morland <liam@openplus.ca>
Date: Tue, 7 Jan 2025 11:22:33 -0500
Subject: [PATCH 01/27] Issue #3497945: Make automated coding standards fixes

---
 layout_builder_st.install                              |  6 ++++--
 layout_builder_st.links.contextual.yml                 |  1 -
 layout_builder_st.module                               | 10 +++++-----
 src/DependencyInjection/ClassResolver.php              |  4 +++-
 src/EventSubscriber/ComponentPluginTranslate.php       |  2 +-
 src/Field/LayoutTranslationItemList.php                |  5 ++++-
 src/Form/BlockContentInlineBlockTranslateForm.php      |  2 +-
 src/Form/OverridesEntityForm.php                       |  6 +++---
 src/Form/TranslateBlockForm.php                        |  6 +++---
 src/InlineBlockEntityOperations.php                    |  1 -
 src/LayoutBuilderStServiceProvider.php                 |  3 +++
 src/Plugin/Block/InlineBlock.php                       |  1 -
 src/Plugin/SectionStorage/OverridesSectionStorage.php  |  5 ++++-
 src/ResourceTypeRepository.php                         |  3 +++
 src/TranslationsHelperTrait.php                        |  5 +----
 tests/src/Functional/LayoutBuilderTranslationTest.php  |  3 +--
 tests/src/Functional/Rest/OverrideSectionsTest.php     |  8 ++++----
 .../InlineBlockTranslationTest.php                     |  2 +-
 .../JavascriptTranslationTestTrait.php                 |  4 ++--
 .../FunctionalJavascript/LayoutBuilderTestTrait.php    |  2 +-
 tests/src/FunctionalJavascript/TranslationTest.php     |  5 ++---
 21 files changed, 46 insertions(+), 38 deletions(-)

diff --git a/layout_builder_st.install b/layout_builder_st.install
index 056b2c2..0495dea 100644
--- a/layout_builder_st.install
+++ b/layout_builder_st.install
@@ -1,10 +1,13 @@
 <?php
 
+/**
+ * @file
+ */
+
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
 
-
 /**
  * Implements hook_install().
  */
@@ -65,7 +68,6 @@ function _layout_builder_st_add_translation_field($entity_type_id, $bundle) {
   }
 }
 
-
 /**
  * Implements hook_requirements().
  */
diff --git a/layout_builder_st.links.contextual.yml b/layout_builder_st.links.contextual.yml
index a23b0c4..e2a31ff 100644
--- a/layout_builder_st.links.contextual.yml
+++ b/layout_builder_st.links.contextual.yml
@@ -17,4 +17,3 @@ layout_builder_inline_block_translate:
       class: ['use-ajax']
       data-dialog-type: dialog
       data-dialog-renderer: off_canvas
-
diff --git a/layout_builder_st.module b/layout_builder_st.module
index 7641d83..8767e0f 100644
--- a/layout_builder_st.module
+++ b/layout_builder_st.module
@@ -1,17 +1,18 @@
 <?php
 
-use Drupal\Component\Plugin\ConfigurableInterface;
+/**
+ * @file
+ */
+
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\layout_builder_st\Entity\LayoutBuilderEntityViewDisplay;
 use Drupal\layout_builder_st\Form\BlockContentInlineBlockTranslateForm;
 use Drupal\layout_builder\Form\OverridesEntityForm as CoreOverridesEntityForm;
-use Drupal\layout_builder_st\Form\BlockPluginTranslationForm;
 use Drupal\layout_builder_st\Form\OverridesEntityForm;
 use Drupal\layout_builder_st\Plugin\Block\InlineBlock;
 use Drupal\layout_builder_st\Plugin\Field\FieldWidget\LayoutBuilderWidget;
 use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
 
-
 /**
  * Implements hook_module_implements_alter().
  */
@@ -27,7 +28,6 @@ function layout_builder_st_module_implements_alter(&$implementations, $hook) {
   }
 }
 
-
 /**
  * Implements hook_entity_type_alter().
  *
@@ -67,7 +67,7 @@ function layout_builder_st_entity_type_alter(array &$entity_types) {
  */
 function layout_builder_st_block_alter(&$definitions) {
   foreach ($definitions as &$definition) {
-    if ($definition['id']  === 'inline_block') {
+    if ($definition['id'] === 'inline_block') {
       // Replace with our extended InlineBlock class to handle translations.
       $definition['class'] = InlineBlock::class;
     }
diff --git a/src/DependencyInjection/ClassResolver.php b/src/DependencyInjection/ClassResolver.php
index 675e8b9..8f03094 100644
--- a/src/DependencyInjection/ClassResolver.php
+++ b/src/DependencyInjection/ClassResolver.php
@@ -11,6 +11,9 @@ use Drupal\layout_builder_st\InlineBlockEntityOperations;
  */
 final class ClassResolver extends CoreClassResolver {
 
+  /**
+   *
+   */
   public function getInstanceFromDefinition($definition) {
     if ($definition === CoreInlineBlockEntityOperations::class) {
       $definition = InlineBlockEntityOperations::class;
@@ -18,5 +21,4 @@ final class ClassResolver extends CoreClassResolver {
     return parent::getInstanceFromDefinition($definition);
   }
 
-
 }
diff --git a/src/EventSubscriber/ComponentPluginTranslate.php b/src/EventSubscriber/ComponentPluginTranslate.php
index 34cbf57..e68d598 100644
--- a/src/EventSubscriber/ComponentPluginTranslate.php
+++ b/src/EventSubscriber/ComponentPluginTranslate.php
@@ -20,7 +20,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 final class ComponentPluginTranslate implements EventSubscriberInterface {
 
   use LayoutEntityHelperTrait;
-  //  This trait will be merged into core's.
+  // This trait will be merged into core's.
   use TranslationsHelperTrait;
 
   /**
diff --git a/src/Field/LayoutTranslationItemList.php b/src/Field/LayoutTranslationItemList.php
index a6e8952..180b9de 100644
--- a/src/Field/LayoutTranslationItemList.php
+++ b/src/Field/LayoutTranslationItemList.php
@@ -6,6 +6,9 @@ use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Field\FieldItemList;
 use Drupal\Core\Session\AccountInterface;
 
+/**
+ *
+ */
 final class LayoutTranslationItemList extends FieldItemList {
 
   /**
@@ -13,7 +16,7 @@ final class LayoutTranslationItemList extends FieldItemList {
    *
    * @ingroup layout_builder_access
    */
-  public function defaultAccess($operation = 'view', AccountInterface $account = NULL) {
+  public function defaultAccess($operation = 'view', ?AccountInterface $account = NULL) {
     // @todo Allow access in https://www.drupal.org/node/2942975.
     return AccessResult::forbidden();
   }
diff --git a/src/Form/BlockContentInlineBlockTranslateForm.php b/src/Form/BlockContentInlineBlockTranslateForm.php
index 9581c68..1f5d771 100644
--- a/src/Form/BlockContentInlineBlockTranslateForm.php
+++ b/src/Form/BlockContentInlineBlockTranslateForm.php
@@ -50,7 +50,7 @@ final class BlockContentInlineBlockTranslateForm extends BlockContentForm {
   /**
    * {@inheritdoc}
    */
-  public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL, RouteMatchInterface $route_match = NULL, LayoutTempstoreRepositoryInterface $tempstore = NULL) {
+  public function __construct(EntityRepositoryInterface $entity_repository, ?EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, ?TimeInterface $time = NULL, ?RouteMatchInterface $route_match = NULL, ?LayoutTempstoreRepositoryInterface $tempstore = NULL) {
     parent::__construct($entity_repository, $entity_type_bundle_info, $time);
     $this->routeMatch = $route_match;
     $this->layoutTempstoreRepository = $tempstore;
diff --git a/src/Form/OverridesEntityForm.php b/src/Form/OverridesEntityForm.php
index 8ff3595..6535ec7 100644
--- a/src/Form/OverridesEntityForm.php
+++ b/src/Form/OverridesEntityForm.php
@@ -9,7 +9,7 @@ use Drupal\layout_builder\SectionStorageInterface;
 use Drupal\layout_builder_st\TranslationsHelperTrait;
 
 /**
- * Extended OverridesEntityForm
+ * Extended OverridesEntityForm.
  */
 final class OverridesEntityForm extends CoreOverridesEntityForm {
 
@@ -18,7 +18,7 @@ final class OverridesEntityForm extends CoreOverridesEntityForm {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, ?SectionStorageInterface $section_storage = NULL) {
     $form = parent::buildForm($form, $form_state, $section_storage);
     $form[OverridesSectionStorage::TRANSLATED_CONFIGURATION_FIELD_NAME]['#access'] = TRUE;
     return $form;
@@ -51,7 +51,7 @@ final class OverridesEntityForm extends CoreOverridesEntityForm {
    */
   protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
-    if(static::isTranslation($this->sectionStorage)) {
+    if (static::isTranslation($this->sectionStorage)) {
       unset($actions['revert']);
     }
     return $actions;
diff --git a/src/Form/TranslateBlockForm.php b/src/Form/TranslateBlockForm.php
index 88d0086..2fdcb06 100644
--- a/src/Form/TranslateBlockForm.php
+++ b/src/Form/TranslateBlockForm.php
@@ -107,7 +107,7 @@ class TranslateBlockForm extends FormBase {
    * @return array
    *   The form array.
    */
-  public function buildForm(array $form, FormStateInterface $form_state, TranslatableSectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $uuid = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, ?TranslatableSectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $uuid = NULL) {
     $component = $section_storage->getSection($delta)->getComponent($uuid);
 
     $this->sectionStorage = $section_storage;
@@ -179,13 +179,13 @@ class TranslateBlockForm extends FormBase {
         $element_build['label']['source'] = [
           '#type' => 'item',
           '#title' => $this->t('Label'),
-          '#markup' => $label_data->getValue()?: '(' . $this->t('Empty') . ')',
+          '#markup' => $label_data->getValue() ?: '(' . $this->t('Empty') . ')',
           '#parents' => ['source', 'label'],
         ];
         $element_build['label']['translation'] = [
           '#type' => 'textfield',
           '#title' => $this->t('Label'),
-          '#default_value' => isset($translated_configuration['label']) ? $translated_configuration['label'] : '',
+          '#default_value' => $translated_configuration['label'] ?? '',
           '#parents' => ['translation', 'label'],
         ];
       }
diff --git a/src/InlineBlockEntityOperations.php b/src/InlineBlockEntityOperations.php
index b4257e9..62b1d8f 100644
--- a/src/InlineBlockEntityOperations.php
+++ b/src/InlineBlockEntityOperations.php
@@ -67,5 +67,4 @@ final class InlineBlockEntityOperations extends CoreInlineBlockEntityOperations
 
   }
 
-
 }
diff --git a/src/LayoutBuilderStServiceProvider.php b/src/LayoutBuilderStServiceProvider.php
index d079ce6..4c7c83d 100644
--- a/src/LayoutBuilderStServiceProvider.php
+++ b/src/LayoutBuilderStServiceProvider.php
@@ -5,6 +5,9 @@ namespace Drupal\layout_builder_st;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceProviderBase;
 
+/**
+ *
+ */
 class LayoutBuilderStServiceProvider extends ServiceProviderBase {
 
   /**
diff --git a/src/Plugin/Block/InlineBlock.php b/src/Plugin/Block/InlineBlock.php
index 6dd5385..3f2d4d1 100644
--- a/src/Plugin/Block/InlineBlock.php
+++ b/src/Plugin/Block/InlineBlock.php
@@ -28,5 +28,4 @@ final class InlineBlock extends CoreInlineBlock {
     return $form;
   }
 
-
 }
diff --git a/src/Plugin/SectionStorage/OverridesSectionStorage.php b/src/Plugin/SectionStorage/OverridesSectionStorage.php
index 27fdd06..1d386be 100644
--- a/src/Plugin/SectionStorage/OverridesSectionStorage.php
+++ b/src/Plugin/SectionStorage/OverridesSectionStorage.php
@@ -8,6 +8,9 @@ use Drupal\Core\Session\AccountInterface;
 use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage as CoreOverridesSectionStorage;
 use Drupal\layout_builder_st\TranslatableSectionStorageInterface;
 
+/**
+ *
+ */
 final class OverridesSectionStorage extends CoreOverridesSectionStorage implements TranslatableSectionStorageInterface {
 
 
@@ -76,7 +79,7 @@ final class OverridesSectionStorage extends CoreOverridesSectionStorage implemen
       return [];
     }
     $translation_settings = $this->getEntity()->get(OverridesSectionStorage::TRANSLATED_CONFIGURATION_FIELD_NAME)->getValue()[0];
-    return isset($translation_settings['value']['components'][$uuid]) ? $translation_settings['value']['components'][$uuid] : [];
+    return $translation_settings['value']['components'][$uuid] ?? [];
   }
 
   /**
diff --git a/src/ResourceTypeRepository.php b/src/ResourceTypeRepository.php
index 8df871a..4ecad05 100644
--- a/src/ResourceTypeRepository.php
+++ b/src/ResourceTypeRepository.php
@@ -6,6 +6,9 @@ use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\jsonapi\ResourceType\ResourceTypeRepository as CoreResourceTypeRepository;
 use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay;
 
+/**
+ *
+ */
 class ResourceTypeRepository extends CoreResourceTypeRepository {
 
   /**
diff --git a/src/TranslationsHelperTrait.php b/src/TranslationsHelperTrait.php
index 0856c13..4a3f91a 100644
--- a/src/TranslationsHelperTrait.php
+++ b/src/TranslationsHelperTrait.php
@@ -1,13 +1,11 @@
 <?php
 
-
 namespace Drupal\layout_builder_st;
 
 use Drupal\layout_builder\SectionStorageInterface;
 
-
 /**
- * Trait for methods that will be added to \Drupal\layout_builder\LayoutEntityHelperTrait
+ * Trait for methods that will be added to \Drupal\layout_builder\LayoutEntityHelperTrait.
  */
 trait TranslationsHelperTrait {
 
@@ -24,5 +22,4 @@ trait TranslationsHelperTrait {
     return $section_storage instanceof TranslatableSectionStorageInterface && !$section_storage->isDefaultTranslation();
   }
 
-
 }
diff --git a/tests/src/Functional/LayoutBuilderTranslationTest.php b/tests/src/Functional/LayoutBuilderTranslationTest.php
index 820f733..59f5ced 100644
--- a/tests/src/Functional/LayoutBuilderTranslationTest.php
+++ b/tests/src/Functional/LayoutBuilderTranslationTest.php
@@ -167,7 +167,6 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $field_config->setTranslatable(TRUE);
     $this->assertNotEmpty($field_config->save());
 
-
     $entity_url = $this->entity->toUrl('canonical')->toString();
     $layout_url = $entity_url . '/layout';
     $language = \Drupal::languageManager()->getLanguage($this->langcodes[2]);
@@ -218,7 +217,6 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $this->drupalGet($entity_url);
     $assert_session->pageTextContains('Powered by Drupal');
 
-
     // Confirm the translation layout is still not allowed.
     $this->drupalGet($translated_layout_url);
 
@@ -235,6 +233,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session->pageTextNotContains('Access denied');
     $assert_session->buttonExists('Save layout');
   }
+
   /**
    * The entity used for testing.
    *
diff --git a/tests/src/Functional/Rest/OverrideSectionsTest.php b/tests/src/Functional/Rest/OverrideSectionsTest.php
index 77d53e3..93582f4 100644
--- a/tests/src/Functional/Rest/OverrideSectionsTest.php
+++ b/tests/src/Functional/Rest/OverrideSectionsTest.php
@@ -55,10 +55,10 @@ class OverrideSectionsTest extends LayoutRestTestBase {
       Url::fromRoute('rest.entity.node.GET', ['node' => $this->node->id()])
     );
     $expected_cache_tags = [
-        'config:filter.format.plain_text',
-        'config:rest.resource.entity.node',
-        'http_response',
-        'node:1',
+      'config:filter.format.plain_text',
+      'config:rest.resource.entity.node',
+      'http_response',
+      'node:1',
     ];
     // Drupal 8 has the rest.settings config object, and its cache tags are
     // expected to be present in the response. In Drupal 9, the config does not
diff --git a/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php b/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
index 455f634..eda8056 100644
--- a/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
+++ b/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
@@ -29,7 +29,7 @@ class InlineBlockTranslationTest extends InlineBlockTestBase {
   protected static $modules = [
     'content_translation',
     'field_ui',
-    'layout_builder_st'
+    'layout_builder_st',
   ];
 
   /**
diff --git a/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php b/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php
index b5d3af7..2b5a8c8 100644
--- a/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php
+++ b/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php
@@ -35,10 +35,10 @@ trait JavascriptTranslationTestTrait {
 
     $translation_selector_prefix = $this->usingConfigTranslation ? '#drupal-off-canvas .translation-set ' : '#drupal-off-canvas ';
     $this->clickContextualLink($block_selector, 'Translate block');
-    $label_input = $assert_session->waitForElementVisible('css', $translation_selector_prefix. '[name="translation[label]"]');
+    $label_input = $assert_session->waitForElementVisible('css', $translation_selector_prefix . '[name="translation[label]"]');
     $this->assertNotEmpty($label_input);
     $this->assertEquals($expected_label, $label_input->getValue());
-    $assert_session->elementTextContains('css', $translation_selector_prefix. '.form-item-source-label', $untranslated_label);
+    $assert_session->elementTextContains('css', $translation_selector_prefix . '.form-item-source-label', $untranslated_label);
     $label_input->setValue($new_label);
     foreach ($unexpected_element_selectors as $unexpected_element_selector) {
       $assert_session->elementNotExists('css', $unexpected_element_selector);
diff --git a/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php b/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php
index ba0a3e9..2df4a45 100644
--- a/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php
+++ b/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php
@@ -62,7 +62,7 @@ trait LayoutBuilderTestTrait {
    * @param string $message
    *   (optional) Custom message to display with the assertion.
    *
-   * @todo: Remove after https://www.drupal.org/project/drupal/issues/2892440
+   * @todo Remove after https://www.drupal.org/project/drupal/issues/2892440
    */
   public function assertNoElementAfterWait($selector, $timeout = 10000, $message = '') {
     $page = $this->getSession()->getPage();
diff --git a/tests/src/FunctionalJavascript/TranslationTest.php b/tests/src/FunctionalJavascript/TranslationTest.php
index 667fd9f..34ba7dd 100644
--- a/tests/src/FunctionalJavascript/TranslationTest.php
+++ b/tests/src/FunctionalJavascript/TranslationTest.php
@@ -67,7 +67,6 @@ class TranslationTest extends WebDriverTestBase {
       $this->container->get('module_installer')->install(['layout_builder_st']);
     }
 
-
     $page = $this->getSession()->getPage();
     $assert_session = $this->assertSession();
 
@@ -115,7 +114,7 @@ class TranslationTest extends WebDriverTestBase {
     // Update the translations block label.
     $this->drupalGet('it/node/1/layout');
     $this->assertNonTranslationActionsRemoved();
-    $this->updateBlockTranslation('.block-system-powered-by-block', 'untranslated label', 'label updated in translation','label in translation');
+    $this->updateBlockTranslation('.block-system-powered-by-block', 'untranslated label', 'label updated in translation', 'label in translation');
 
     $assert_session->buttonExists('Save layout');
     $page->pressButton('Save layout');
@@ -138,7 +137,7 @@ class TranslationTest extends WebDriverTestBase {
 
     $this->createContentType([
       'type' => 'bundle_with_section_field',
-      'new_revision' => TRUE
+      'new_revision' => TRUE,
     ]);
     $this->createNode([
       'type' => 'bundle_with_section_field',
-- 
GitLab


From 6213e962f870cfe387e722bead7621588359dadb Mon Sep 17 00:00:00 2001
From: "joseph.olstad" <joseph.olstad@1321830.no-reply.drupal.org>
Date: Tue, 7 Jan 2025 11:52:57 -0500
Subject: [PATCH 02/27] Issue #3497945: Add comments

---
 src/DependencyInjection/ClassResolver.php             | 2 +-
 src/Field/LayoutTranslationItemList.php               | 2 +-
 src/LayoutBuilderStServiceProvider.php                | 2 +-
 src/Plugin/SectionStorage/OverridesSectionStorage.php | 2 +-
 src/ResourceTypeRepository.php                        | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/DependencyInjection/ClassResolver.php b/src/DependencyInjection/ClassResolver.php
index 8f03094..6180256 100644
--- a/src/DependencyInjection/ClassResolver.php
+++ b/src/DependencyInjection/ClassResolver.php
@@ -12,7 +12,7 @@ use Drupal\layout_builder_st\InlineBlockEntityOperations;
 final class ClassResolver extends CoreClassResolver {
 
   /**
-   *
+   * {@inheritdoc}
    */
   public function getInstanceFromDefinition($definition) {
     if ($definition === CoreInlineBlockEntityOperations::class) {
diff --git a/src/Field/LayoutTranslationItemList.php b/src/Field/LayoutTranslationItemList.php
index 180b9de..93b05d0 100644
--- a/src/Field/LayoutTranslationItemList.php
+++ b/src/Field/LayoutTranslationItemList.php
@@ -7,7 +7,7 @@ use Drupal\Core\Field\FieldItemList;
 use Drupal\Core\Session\AccountInterface;
 
 /**
- *
+ * A list of layout translation items.
  */
 final class LayoutTranslationItemList extends FieldItemList {
 
diff --git a/src/LayoutBuilderStServiceProvider.php b/src/LayoutBuilderStServiceProvider.php
index 4c7c83d..5752426 100644
--- a/src/LayoutBuilderStServiceProvider.php
+++ b/src/LayoutBuilderStServiceProvider.php
@@ -6,7 +6,7 @@ use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceProviderBase;
 
 /**
- *
+ * Layout builder symmetric translations service provider.
  */
 class LayoutBuilderStServiceProvider extends ServiceProviderBase {
 
diff --git a/src/Plugin/SectionStorage/OverridesSectionStorage.php b/src/Plugin/SectionStorage/OverridesSectionStorage.php
index 1d386be..d56f377 100644
--- a/src/Plugin/SectionStorage/OverridesSectionStorage.php
+++ b/src/Plugin/SectionStorage/OverridesSectionStorage.php
@@ -9,7 +9,7 @@ use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage as CoreO
 use Drupal\layout_builder_st\TranslatableSectionStorageInterface;
 
 /**
- *
+ * {@inheritdoc}
  */
 final class OverridesSectionStorage extends CoreOverridesSectionStorage implements TranslatableSectionStorageInterface {
 
diff --git a/src/ResourceTypeRepository.php b/src/ResourceTypeRepository.php
index 4ecad05..ad1fe09 100644
--- a/src/ResourceTypeRepository.php
+++ b/src/ResourceTypeRepository.php
@@ -7,7 +7,7 @@ use Drupal\jsonapi\ResourceType\ResourceTypeRepository as CoreResourceTypeReposi
 use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay;
 
 /**
- *
+ * Protect raw layout section data.
  */
 class ResourceTypeRepository extends CoreResourceTypeRepository {
 
-- 
GitLab


From bf67852deed845347d1795ce5388ef512dbbee29 Mon Sep 17 00:00:00 2001
From: Liam Morland <24363-lkmorlan@users.noreply.drupalcode.org>
Date: Wed, 8 Jan 2025 19:31:18 +0000
Subject: [PATCH 03/27] Issue #3497945: Make coding standards fixes

---
 layout_builder_st.install | 4 +++-
 layout_builder_st.module  | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/layout_builder_st.install b/layout_builder_st.install
index 0495dea..34cbd48 100644
--- a/layout_builder_st.install
+++ b/layout_builder_st.install
@@ -2,11 +2,13 @@
 
 /**
  * @file
+ * Contains installation and update hooks for layout_builder_st.
  */
 
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
+use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage as LayoutBuilderOverridesSectionStorage;
 
 /**
  * Implements hook_install().
@@ -17,7 +19,7 @@ function layout_builder_st_install() {
   $field_manager = \Drupal::service('entity_field.manager');
   $field_map = $field_manager->getFieldMap();
   foreach ($field_map as $entity_type_id => $field_infos) {
-    if (isset($field_infos[\Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::FIELD_NAME]['bundles'])) {
+    if (isset($field_infos[LayoutBuilderOverridesSectionStorage::FIELD_NAME]['bundles'])) {
       $non_translatable_bundle_count = 0;
       foreach ($field_infos[OverridesSectionStorage::FIELD_NAME]['bundles'] as $bundle) {
         $bundles_not_added = [];
diff --git a/layout_builder_st.module b/layout_builder_st.module
index 8767e0f..9e7487c 100644
--- a/layout_builder_st.module
+++ b/layout_builder_st.module
@@ -2,6 +2,7 @@
 
 /**
  * @file
+ * Contains hook implementations for layout_builder_st.
  */
 
 use Drupal\Core\Entity\FieldableEntityInterface;
-- 
GitLab


From b6a6dabbf15a38c65a3327376cb7ac6b09479d3c Mon Sep 17 00:00:00 2001
From: Liam Morland <liam@openplus.ca>
Date: Thu, 20 Feb 2025 17:40:00 -0500
Subject: [PATCH 04/27] Call ContentTranslationTestBase::doSetup() in
 LayoutBuilderTranslationTest::setUp()

---
 tests/src/Functional/LayoutBuilderTranslationTest.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/src/Functional/LayoutBuilderTranslationTest.php b/tests/src/Functional/LayoutBuilderTranslationTest.php
index 59f5ced..e76e0b3 100644
--- a/tests/src/Functional/LayoutBuilderTranslationTest.php
+++ b/tests/src/Functional/LayoutBuilderTranslationTest.php
@@ -40,6 +40,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
    */
   protected function setUp(): void {
     parent::setUp();
+    $this->doSetup();
     $this->setUpViewDisplay();
     $this->setUpEntities();
   }
-- 
GitLab


From 1f67e13550ad0e5ea2af38d6d815557f5bbb872c Mon Sep 17 00:00:00 2001
From: Daniel Rodriguez <danrod@gmail.com>
Date: Wed, 26 Mar 2025 19:15:56 -0400
Subject: [PATCH 05/27] Issue # 3497945: PHPCS fixes, fixed mostly comment
 issues for now

---
 layout_builder_st.module            | 4 +---
 src/InlineBlockEntityOperations.php | 4 +++-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/layout_builder_st.module b/layout_builder_st.module
index 9e7487c..2cc0641 100644
--- a/layout_builder_st.module
+++ b/layout_builder_st.module
@@ -32,7 +32,7 @@ function layout_builder_st_module_implements_alter(&$implementations, $hook) {
 /**
  * Implements hook_entity_type_alter().
  *
- * Copied from https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
+ * See: https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
  */
 function layout_builder_st_entity_type_alter(array &$entity_types) {
 
@@ -77,8 +77,6 @@ function layout_builder_st_block_alter(&$definitions) {
 
 /**
  * Implements hook_layout_builder_section_storage_alter().
- *
- * @param \Drupal\layout_builder\SectionStorage\SectionStorageDefinition[] $definitions
  */
 function layout_builder_st_layout_builder_section_storage_alter(array &$definitions) {
   $definition = $definitions['overrides'];
diff --git a/src/InlineBlockEntityOperations.php b/src/InlineBlockEntityOperations.php
index 62b1d8f..3673a60 100644
--- a/src/InlineBlockEntityOperations.php
+++ b/src/InlineBlockEntityOperations.php
@@ -7,7 +7,9 @@ use Drupal\layout_builder\InlineBlockEntityOperations as CoreInlineBlockEntityOp
 use Drupal\layout_builder\SectionComponent;
 
 /**
- * Overrides cores InlineBlockEntityOperations to provide translation operations.
+ * This class overrides core InlineBlockEntityOperations.
+ *
+ * This was implemented to provide translation operations.
  */
 final class InlineBlockEntityOperations extends CoreInlineBlockEntityOperations {
 
-- 
GitLab


From bd89523d3b95ab20161619814383e8c522517f1e Mon Sep 17 00:00:00 2001
From: Daniel Rodriguez <danrod@gmail.com>
Date: Wed, 26 Mar 2025 19:55:42 -0400
Subject: [PATCH 06/27] Issue # 3497945: More PHPCS comment fixes

---
 src/Element/LayoutBuilder.php    | 14 +++++++-------
 src/Form/OverridesEntityForm.php |  2 +-
 src/Form/TranslateBlockForm.php  |  2 ++
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/Element/LayoutBuilder.php b/src/Element/LayoutBuilder.php
index 237c5ad..1830f53 100644
--- a/src/Element/LayoutBuilder.php
+++ b/src/Element/LayoutBuilder.php
@@ -113,14 +113,12 @@ final class LayoutBuilder extends CoreLayoutbuilder {
    *
    * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
    *   The section storage.
-   * @param $delta
+   * @param string $delta
    *   The section delta.
-   * @param $region
+   * @param string $region
    *   The region.
-   * @param $uuid
+   * @param string $uuid
    *   The UUID of the component.
-   * @param $is_translation
-   *   Whether the section storage is handling a translation.
    *
    * @return array|null
    *   The contextual link render array or NULL if none.
@@ -174,11 +172,13 @@ final class LayoutBuilder extends CoreLayoutbuilder {
   /**
    * Determines whether the component has translatable configuration.
    *
-   * This function is replacement for \Drupal\layout_builder\SectionComponent::hasTranslatableConfiguration()
-   * in https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
+   * This function is replacement for the method:
+   * \Drupal\layout_builder\SectionComponent::hasTranslatableConfiguration()
+   * Read: https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
    * This avoids having to alter the class in the module.
    *
    * @param \Drupal\layout_builder\SectionComponent $component
+   *   The section component of the Layout Builder.
    *
    * @return bool
    *   TRUE if the plugin has translatable configuration.
diff --git a/src/Form/OverridesEntityForm.php b/src/Form/OverridesEntityForm.php
index 6535ec7..94e11da 100644
--- a/src/Form/OverridesEntityForm.php
+++ b/src/Form/OverridesEntityForm.php
@@ -9,7 +9,7 @@ use Drupal\layout_builder\SectionStorageInterface;
 use Drupal\layout_builder_st\TranslationsHelperTrait;
 
 /**
- * Extended OverridesEntityForm.
+ * This class extends core class OverridesEntityForm.
  */
 final class OverridesEntityForm extends CoreOverridesEntityForm {
 
diff --git a/src/Form/TranslateBlockForm.php b/src/Form/TranslateBlockForm.php
index 2fdcb06..a5faee8 100644
--- a/src/Form/TranslateBlockForm.php
+++ b/src/Form/TranslateBlockForm.php
@@ -57,6 +57,8 @@ class TranslateBlockForm extends FormBase {
   protected $moduleHandler;
 
   /**
+   * The typed config manager.
+   *
    * @var \Drupal\Core\Config\TypedConfigManagerInterface
    */
   protected $typedConfigManager;
-- 
GitLab


From 844f28b1af8f7cf8acda1a4b3b337c3b90dbb089 Mon Sep 17 00:00:00 2001
From: Daniel Rodriguez <danrod@gmail.com>
Date: Thu, 27 Mar 2025 18:58:54 -0400
Subject: [PATCH 07/27] Issue # 3497945: Applied a suggested fix by Joseph
 Oldstad to fix a deprecation notice about calling ClassResolver::__construct
 without the  argument

---
 layout_builder_st.services.yml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/layout_builder_st.services.yml b/layout_builder_st.services.yml
index 225ac7d..fb1167d 100644
--- a/layout_builder_st.services.yml
+++ b/layout_builder_st.services.yml
@@ -17,8 +17,9 @@ services:
   # Override the class resolver to so that InlineBlockEntityOperations can be swapped to the extend version.
   class_resolver:
     class: Drupal\layout_builder_st\DependencyInjection\ClassResolver
-    calls:
-      - [setContainer, ['@service_container']]
+    arguments: ['@service_container']
+  Drupal\Core\DependencyInjection\ClassResolverInterface: '@class_resolver'
   plugin.manager.element_info:
     class: Drupal\layout_builder_st\ElementManager
-    arguments: ['@container.namespaces', '@cache.discovery', '@cache_tags.invalidator', '@module_handler', '@theme.manager']
+    arguments: ['@container.namespaces', '@cache.discovery', '@theme_handler', '@module_handler', '@theme.manager']
+    Drupal\Core\Render\ElementInfoManagerInterface: '@plugin.manager.element_info'
-- 
GitLab


From 3e7e3e74b3b317a958123b2f9d7b3ee0114121b8 Mon Sep 17 00:00:00 2001
From: "joseph.olstad" <joseph.olstad@1321830.no-reply.drupal.org>
Date: Wed, 2 Apr 2025 15:39:14 -0400
Subject: [PATCH 08/27] Issue # 3497945: Put spelling exception in
 .gitlab-ci.yml

---
 .gitlab-ci.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2752f44..020aef2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,4 +29,5 @@ variables:
   OPT_IN_TEST_NEXT_MINOR: '1'
   OPT_IN_TEST_PREVIOUS_MAJOR: '1'
   OPT_IN_TEST_PREVIOUS_MINOR: '1'
+  _CSPELL_WORDS: 'blocknodebundle, fieldbody'
 #   _CURL_TEMPLATES_REF: 'main'
-- 
GitLab


From b66fb7e8a018d9ac680a03f65af4a323b61018eb Mon Sep 17 00:00:00 2001
From: "joseph.olstad" <joseph.olstad@1321830.no-reply.drupal.org>
Date: Wed, 2 Apr 2025 15:44:11 -0400
Subject: [PATCH 09/27] Issue #3497945: Put more spelling exceptions in
 .gitlab-ci.yml

---
 .gitlab-ci.yml                |  2 +-
 layout_builder_st.module      |  2 +-
 src/Element/LayoutBuilder.php | 10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 020aef2..6ad7992 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,5 +29,5 @@ variables:
   OPT_IN_TEST_NEXT_MINOR: '1'
   OPT_IN_TEST_PREVIOUS_MAJOR: '1'
   OPT_IN_TEST_PREVIOUS_MINOR: '1'
-  _CSPELL_WORDS: 'blocknodebundle, fieldbody'
+  _CSPELL_WORDS: 'blocknodebundle, dataprovider, fieldbody, layoutbuilder'
 #   _CURL_TEMPLATES_REF: 'main'
diff --git a/layout_builder_st.module b/layout_builder_st.module
index 2cc0641..731a634 100644
--- a/layout_builder_st.module
+++ b/layout_builder_st.module
@@ -47,7 +47,7 @@ function layout_builder_st_entity_type_alter(array &$entity_types) {
       $form_class = $entity_type->getFormClass('layout_builder');
       if ($form_class !== CoreOverridesEntityForm::class) {
         \Drupal::messenger()->addError(
-          t('The "layout_builder" form class for @entity_type entity type is already overriden by @class. This is incompatible with the layout_builder_st module'),
+          t('The "layout_builder" form class for @entity_type entity type is already overridden by @class. This is incompatible with the layout_builder_st module'),
           [
             '@entity_type' => $entity_type->getLabel(),
             '@class' => $form_class,
diff --git a/src/Element/LayoutBuilder.php b/src/Element/LayoutBuilder.php
index 1830f53..4cd1ba0 100644
--- a/src/Element/LayoutBuilder.php
+++ b/src/Element/LayoutBuilder.php
@@ -64,7 +64,7 @@ final class LayoutBuilder extends CoreLayoutbuilder {
    */
   protected function buildAddSectionLink(SectionStorageInterface $section_storage, $delta) {
     $link = parent::buildAddSectionLink($section_storage, $delta);
-    $this->setTranslationAcess($link, $section_storage);
+    $this->setTranslationAccess($link, $section_storage);
     return $link;
   }
 
@@ -73,12 +73,12 @@ final class LayoutBuilder extends CoreLayoutbuilder {
    */
   protected function buildAdministrativeSection(SectionStorageInterface $section_storage, $delta) {
     $section_build = parent::buildAdministrativeSection($section_storage, $delta);
-    $this->setTranslationAcess($section_build['remove'], $section_storage);
-    $this->setTranslationAcess($section_build['configure'], $section_storage);
+    $this->setTranslationAccess($section_build['remove'], $section_storage);
+    $this->setTranslationAccess($section_build['configure'], $section_storage);
     if (static::isTranslation($section_storage)) {
       foreach (Element::children($section_build['layout-builder__section']) as $region) {
         $region_build = &$section_build['layout-builder__section'][$region];
-        $this->setTranslationAcess($region_build['layout_builder_add_block'], $section_storage);
+        $this->setTranslationAccess($region_build['layout_builder_add_block'], $section_storage);
         foreach (Element::children($region_build) as $uuid) {
           if (substr_count($uuid, '-') !== 4) {
             continue;
@@ -104,7 +104,7 @@ final class LayoutBuilder extends CoreLayoutbuilder {
   /**
    * Set the #access property based section storage translation.
    */
-  private function setTranslationAcess(array &$build, SectionStorageInterface $section_storage) {
+  private function setTranslationAccess(array &$build, SectionStorageInterface $section_storage) {
     $build['#access'] = !static::isTranslation($section_storage);
   }
 
-- 
GitLab


From 72989bc5bf4c9a2a947b0ede6a3db1d836882ad8 Mon Sep 17 00:00:00 2001
From: "joseph.olstad" <joseph.olstad@1321830.no-reply.drupal.org>
Date: Wed, 2 Apr 2025 15:46:08 -0400
Subject: [PATCH 10/27] Issue #3497945: Do not run tests on unsupported
 versions of Drupal.

---
 .gitlab-ci.yml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6ad7992..8eaba71 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,9 +25,10 @@ include:
 ################
 variables:
 #   SKIP_ESLINT: '1'
-  OPT_IN_TEST_NEXT_MAJOR: '1'
-  OPT_IN_TEST_NEXT_MINOR: '1'
+  OPT_IN_TEST_CURRENT: '0'
+  OPT_IN_TEST_NEXT_MAJOR: '0'
+  OPT_IN_TEST_NEXT_MINOR: '0'
   OPT_IN_TEST_PREVIOUS_MAJOR: '1'
-  OPT_IN_TEST_PREVIOUS_MINOR: '1'
+  OPT_IN_TEST_PREVIOUS_MINOR: '0'
   _CSPELL_WORDS: 'blocknodebundle, dataprovider, fieldbody, layoutbuilder'
 #   _CURL_TEMPLATES_REF: 'main'
-- 
GitLab


From 7676424bd91eb0ed6c9d5bfe17febeed6486ca4c Mon Sep 17 00:00:00 2001
From: Daniel Rodriguez <danrod@gmail.com>
Date: Thu, 27 Mar 2025 16:47:32 -0400
Subject: [PATCH 11/27] Issue # 3497945: Added more PHPCS fixes (mostly comment
 fixes)

---
 src/TranslationsHelperTrait.php                                | 2 +-
 .../Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php        | 3 ++-
 .../Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php   | 3 ++-
 .../Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php      | 3 ++-
 .../Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php         | 3 ++-
 .../Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php    | 3 ++-
 .../Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php       | 3 ++-
 7 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/TranslationsHelperTrait.php b/src/TranslationsHelperTrait.php
index 4a3f91a..3288be1 100644
--- a/src/TranslationsHelperTrait.php
+++ b/src/TranslationsHelperTrait.php
@@ -5,7 +5,7 @@ namespace Drupal\layout_builder_st;
 use Drupal\layout_builder\SectionStorageInterface;
 
 /**
- * Trait for methods that will be added to \Drupal\layout_builder\LayoutEntityHelperTrait.
+ * Trait for methods that will be added to LayoutEntityHelperTrait.
  */
 trait TranslationsHelperTrait {
 
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php
index 99c1573..277a648 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php
@@ -5,7 +5,8 @@ namespace Drupal\Tests\layout_builder_st\Functional\Rest;
 use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
 
 /**
- * @group layout_builder
+ * Class that extends the Resource Test Base Class.
+ *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayJsonAnonTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php
index c3ec00e..18118cb 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php
@@ -5,7 +5,8 @@ namespace Drupal\Tests\layout_builder_st\Functional\Rest;
 use Drupal\Tests\rest\Functional\BasicAuthResourceTestTrait;
 
 /**
- * @group layout_builder
+ * Class that extends the Display Resource Test Base class.
+ *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayJsonBasicAuthTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php
index fe2e975..2ba8be3 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php
@@ -5,7 +5,8 @@ namespace Drupal\Tests\layout_builder_st\Functional\Rest;
 use Drupal\Tests\rest\Functional\CookieResourceTestTrait;
 
 /**
- * @group layout_builder
+ * Base class for performing the Json Cookie test.
+ *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayJsonCookieTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php
index 7a42c01..fa35e9b 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php
@@ -6,7 +6,8 @@ use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
 use Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait;
 
 /**
- * @group layout_builder
+ * Base class for performing the XML Anon user test.
+ *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayXmlAnonTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php
index 9ecbb28..8d85437 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php
@@ -6,7 +6,8 @@ use Drupal\Tests\rest\Functional\BasicAuthResourceTestTrait;
 use Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait;
 
 /**
- * @group layout_builder
+ * Base class for performing the XML Basic Auth test.
+ *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayXmlBasicAuthTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php
index 64546fb..c686ef8 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php
@@ -6,7 +6,8 @@ use Drupal\Tests\rest\Functional\CookieResourceTestTrait;
 use Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait;
 
 /**
- * @group layout_builder
+ * Base class for performing the XML Cookie test.
+ *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayXmlCookieTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
-- 
GitLab


From 39bbe2504be4a09884f0e1088d7dfb724025621d Mon Sep 17 00:00:00 2001
From: "joseph.olstad" <joseph.olstad@1321830.no-reply.drupal.org>
Date: Fri, 3 Jan 2025 12:10:00 -0500
Subject: [PATCH 12/27] Issue #3431600 by joseph.olstad: PHP 8.0+ fix.

---
 .../Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php b/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php
index aa67463..b8379b9 100644
--- a/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php
+++ b/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php
@@ -40,7 +40,7 @@ class LayoutBuilderEntityViewDisplayTest extends CoreTest {
   /**
    * {@inheritdoc}
    */
-  protected function getExpectedDocument() {
+  protected function getExpectedDocument(): array {
     $document = parent::getExpectedDocument();
     $document['data']['attributes']['hidden'][OverridesSectionStorage::TRANSLATED_CONFIGURATION_FIELD_NAME] = TRUE;
     return $document;
-- 
GitLab


From 9993b6ed2a78c683c0e691c65b4e13e10e1e28d6 Mon Sep 17 00:00:00 2001
From: Liam Morland <liam@openplus.ca>
Date: Thu, 20 Feb 2025 17:40:00 -0500
Subject: [PATCH 13/27] Call ContentTranslationTestBase::doSetup() in
 LayoutBuilderTranslationTest::setUp()

---
 tests/src/Functional/LayoutBuilderTranslationTest.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/src/Functional/LayoutBuilderTranslationTest.php b/tests/src/Functional/LayoutBuilderTranslationTest.php
index e76e0b3..9aca8a3 100644
--- a/tests/src/Functional/LayoutBuilderTranslationTest.php
+++ b/tests/src/Functional/LayoutBuilderTranslationTest.php
@@ -40,6 +40,8 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
    */
   protected function setUp(): void {
     parent::setUp();
+    // Explicitly install required modules.
+    $this->container->get('module_installer')->install(self::$modules);
     $this->doSetup();
     $this->setUpViewDisplay();
     $this->setUpEntities();
-- 
GitLab


From dcffc9596c9f25193b111321098a22e047bd9d77 Mon Sep 17 00:00:00 2001
From: "joseph.olstad" <joseph.olstad@1321830.no-reply.drupal.org>
Date: Fri, 3 Jan 2025 12:15:03 -0500
Subject: [PATCH 14/27] Issue #3431600 by joseph.olstad: PHP 8.0+ fix for
 testGetIndividual.

---
 .../Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php b/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php
index b8379b9..a261f7f 100644
--- a/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php
+++ b/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php
@@ -23,7 +23,7 @@ class LayoutBuilderEntityViewDisplayTest extends CoreTest {
   /**
    * {@inheritdoc}
    */
-  public function testGetIndividual() {
+  public function testGetIndividual(): void {
     $resource_type_repository = $this->container->get('jsonapi.resource_type.repository');
     $this->assertInstanceOf(ResourceTypeRepository::class, $resource_type_repository);
 
-- 
GitLab


From 553483fe36b48ae6d2fcdea37570c9b5b6dedd36 Mon Sep 17 00:00:00 2001
From: "joseph.olstad" <joseph.olstad@1321830.no-reply.drupal.org>
Date: Wed, 2 Apr 2025 16:48:18 -0400
Subject: [PATCH 15/27] Issue #3497945 - Remove the extra line after a block
 comment as per phpcs.

---
 src/Element/LayoutBuilder.php | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/Element/LayoutBuilder.php b/src/Element/LayoutBuilder.php
index 4cd1ba0..a931265 100644
--- a/src/Element/LayoutBuilder.php
+++ b/src/Element/LayoutBuilder.php
@@ -122,7 +122,6 @@ final class LayoutBuilder extends CoreLayoutbuilder {
    *
    * @return array|null
    *   The contextual link render array or NULL if none.
-   *
    */
   private function createContextualLinkElement(SectionStorageInterface $section_storage, $delta, $region, $uuid) {
     $section = $section_storage->getSection($delta);
-- 
GitLab


From efab0dc72a8152eaa79eb1d1c03a7b569aa839ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= <adam@phenaproxima.net>
Date: Wed, 2 Apr 2025 19:59:18 -0400
Subject: [PATCH 16/27] Revert GitLab CI changes

---
 .gitlab-ci.yml | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8eaba71..020aef2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,10 +25,9 @@ include:
 ################
 variables:
 #   SKIP_ESLINT: '1'
-  OPT_IN_TEST_CURRENT: '0'
-  OPT_IN_TEST_NEXT_MAJOR: '0'
-  OPT_IN_TEST_NEXT_MINOR: '0'
+  OPT_IN_TEST_NEXT_MAJOR: '1'
+  OPT_IN_TEST_NEXT_MINOR: '1'
   OPT_IN_TEST_PREVIOUS_MAJOR: '1'
-  OPT_IN_TEST_PREVIOUS_MINOR: '0'
-  _CSPELL_WORDS: 'blocknodebundle, dataprovider, fieldbody, layoutbuilder'
+  OPT_IN_TEST_PREVIOUS_MINOR: '1'
+  _CSPELL_WORDS: 'blocknodebundle, fieldbody'
 #   _CURL_TEMPLATES_REF: 'main'
-- 
GitLab


From b5d4caffdb593aa69666fa132b03bc5d4e73a1dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= <adam@phenaproxima.net>
Date: Wed, 2 Apr 2025 20:06:23 -0400
Subject: [PATCH 17/27] Drop Drupal 9 support, allow Drupal 11 support

---
 layout_builder_st.info.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layout_builder_st.info.yml b/layout_builder_st.info.yml
index 68c228f..8e1f02d 100644
--- a/layout_builder_st.info.yml
+++ b/layout_builder_st.info.yml
@@ -2,6 +2,6 @@ name: 'Layout Builder Symmetric Translations'
 type: module
 description: 'Allows translating Layout overrides'
 package: Layout Builder
-core_version_requirement: ^9.1 || ^10
+core_version_requirement: ^10 || ^11
 dependencies:
   - drupal:layout_builder
-- 
GitLab


From 72b39ff452e1f7855db5e792f3ea1aaa635cc8df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= <adam@phenaproxima.net>
Date: Wed, 2 Apr 2025 20:07:51 -0400
Subject: [PATCH 18/27] Remove a pointless call to the module installer from
 LayoutBuilderTranslationTest

---
 tests/src/Functional/LayoutBuilderTranslationTest.php | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tests/src/Functional/LayoutBuilderTranslationTest.php b/tests/src/Functional/LayoutBuilderTranslationTest.php
index 9aca8a3..e76e0b3 100644
--- a/tests/src/Functional/LayoutBuilderTranslationTest.php
+++ b/tests/src/Functional/LayoutBuilderTranslationTest.php
@@ -40,8 +40,6 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
    */
   protected function setUp(): void {
     parent::setUp();
-    // Explicitly install required modules.
-    $this->container->get('module_installer')->install(self::$modules);
     $this->doSetup();
     $this->setUpViewDisplay();
     $this->setUpEntities();
-- 
GitLab


From 56458d56350b4c9c26222d6f5bb716a8c1d85f6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= <adam@phenaproxima.net>
Date: Wed, 2 Apr 2025 20:11:06 -0400
Subject: [PATCH 19/27] Type hints, cleanup

---
 layout_builder_st.install | 21 +++++++--------------
 layout_builder_st.module  | 15 +++++++--------
 2 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/layout_builder_st.install b/layout_builder_st.install
index 34cbd48..bb99fcc 100644
--- a/layout_builder_st.install
+++ b/layout_builder_st.install
@@ -8,7 +8,6 @@
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
-use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage as LayoutBuilderOverridesSectionStorage;
 
 /**
  * Implements hook_install().
@@ -19,21 +18,15 @@ function layout_builder_st_install() {
   $field_manager = \Drupal::service('entity_field.manager');
   $field_map = $field_manager->getFieldMap();
   foreach ($field_map as $entity_type_id => $field_infos) {
-    if (isset($field_infos[LayoutBuilderOverridesSectionStorage::FIELD_NAME]['bundles'])) {
-      $non_translatable_bundle_count = 0;
-      foreach ($field_infos[OverridesSectionStorage::FIELD_NAME]['bundles'] as $bundle) {
-        $bundles_not_added = [];
-        // The field map can contain stale information. If the field does not
-        // exist, ignore it. The field map will be rebuilt when the cache is
-        // cleared at the end of the update process.
-        if (!$field_config = FieldConfig::loadByName($entity_type_id, $bundle, OverridesSectionStorage::FIELD_NAME)) {
-          continue;
-        }
-        _layout_builder_st_add_translation_field($entity_type_id, $bundle);
-
+    foreach ($field_infos[OverridesSectionStorage::FIELD_NAME]['bundles'] ?? [] as $bundle) {
+      // The field map can contain stale information. If the field does not
+      // exist, ignore it. The field map will be rebuilt when the cache is
+      // cleared at the end of the update process.
+      if (!FieldConfig::loadByName($entity_type_id, $bundle, OverridesSectionStorage::FIELD_NAME)) {
+        continue;
       }
+      _layout_builder_st_add_translation_field($entity_type_id, $bundle);
     }
-
   }
 }
 
diff --git a/layout_builder_st.module b/layout_builder_st.module
index 731a634..60a6e10 100644
--- a/layout_builder_st.module
+++ b/layout_builder_st.module
@@ -17,7 +17,7 @@ use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
 /**
  * Implements hook_module_implements_alter().
  */
-function layout_builder_st_module_implements_alter(&$implementations, $hook) {
+function layout_builder_st_module_implements_alter(&$implementations, $hook): void {
   switch ($hook) {
     // Move our hook_entity_type_alter() implementation to the end of the list.
     // it must run after layout_builder_st_entity_type_alter().
@@ -32,10 +32,9 @@ function layout_builder_st_module_implements_alter(&$implementations, $hook) {
 /**
  * Implements hook_entity_type_alter().
  *
- * See: https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
+ * @see https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
  */
-function layout_builder_st_entity_type_alter(array &$entity_types) {
-
+function layout_builder_st_entity_type_alter(array &$entity_types): void {
   // Replace entity_view_display class with our own.
   /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['entity_view_display']
@@ -66,7 +65,7 @@ function layout_builder_st_entity_type_alter(array &$entity_types) {
 /**
  * Implements hook_block_alter().
  */
-function layout_builder_st_block_alter(&$definitions) {
+function layout_builder_st_block_alter(array &$definitions): void {
   foreach ($definitions as &$definition) {
     if ($definition['id'] === 'inline_block') {
       // Replace with our extended InlineBlock class to handle translations.
@@ -78,7 +77,7 @@ function layout_builder_st_block_alter(&$definitions) {
 /**
  * Implements hook_layout_builder_section_storage_alter().
  */
-function layout_builder_st_layout_builder_section_storage_alter(array &$definitions) {
+function layout_builder_st_layout_builder_section_storage_alter(array &$definitions): void {
   $definition = $definitions['overrides'];
   $definition->setClass(OverridesSectionStorage::class);
 }
@@ -86,7 +85,7 @@ function layout_builder_st_layout_builder_section_storage_alter(array &$definiti
 /**
  * Implements hook_field_widget_info_alter().
  */
-function layout_builder_st_field_widget_info_alter(array &$info) {
+function layout_builder_st_field_widget_info_alter(array &$info): void {
   if (isset($info['layout_builder_widget'])) {
     $info['layout_builder_widget']['field_types'][] = 'layout_translation';
     $info['layout_builder_widget']['class'] = LayoutBuilderWidget::class;
@@ -97,7 +96,7 @@ function layout_builder_st_field_widget_info_alter(array &$info) {
 /**
  * Implements hook_modules_installed().
  */
-function layout_builder_st_modules_installed($modules) {
+function layout_builder_st_modules_installed(array $modules): void {
   if (in_array('layout_builder_at', $modules)) {
     \Drupal::messenger()->addError('Layout Builder Symmetric Translations is not compatible with Layout Builder Asymmetric Translations. One of these should be uninstalled');
   }
-- 
GitLab


From c12618d0332c95ec128f8d8cda898a85abc2208d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= <adam@phenaproxima.net>
Date: Wed, 2 Apr 2025 20:14:27 -0400
Subject: [PATCH 20/27] Remove or rephase meaningless comments

---
 src/LayoutBuilderStServiceProvider.php                          | 2 +-
 src/ResourceTypeRepository.php                                  | 2 +-
 src/TranslationsHelperTrait.php                                 | 2 +-
 .../Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php         | 2 --
 .../Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php    | 2 --
 .../Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php       | 2 --
 .../Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php          | 2 --
 .../Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php     | 2 --
 .../Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php        | 2 --
 9 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/src/LayoutBuilderStServiceProvider.php b/src/LayoutBuilderStServiceProvider.php
index 5752426..3ee2f99 100644
--- a/src/LayoutBuilderStServiceProvider.php
+++ b/src/LayoutBuilderStServiceProvider.php
@@ -6,7 +6,7 @@ use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceProviderBase;
 
 /**
- * Layout builder symmetric translations service provider.
+ * Overrides core services.
  */
 class LayoutBuilderStServiceProvider extends ServiceProviderBase {
 
diff --git a/src/ResourceTypeRepository.php b/src/ResourceTypeRepository.php
index ad1fe09..da63508 100644
--- a/src/ResourceTypeRepository.php
+++ b/src/ResourceTypeRepository.php
@@ -7,7 +7,7 @@ use Drupal\jsonapi\ResourceType\ResourceTypeRepository as CoreResourceTypeReposi
 use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay;
 
 /**
- * Protect raw layout section data.
+ * Prevents raw layout section data from being exposed via the HTTP API.
  */
 class ResourceTypeRepository extends CoreResourceTypeRepository {
 
diff --git a/src/TranslationsHelperTrait.php b/src/TranslationsHelperTrait.php
index 3288be1..5c9c385 100644
--- a/src/TranslationsHelperTrait.php
+++ b/src/TranslationsHelperTrait.php
@@ -5,7 +5,7 @@ namespace Drupal\layout_builder_st;
 use Drupal\layout_builder\SectionStorageInterface;
 
 /**
- * Trait for methods that will be added to LayoutEntityHelperTrait.
+ * Trait for methods that will be added to core's LayoutEntityHelperTrait.
  */
 trait TranslationsHelperTrait {
 
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php
index 277a648..83bd98d 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php
@@ -5,8 +5,6 @@ namespace Drupal\Tests\layout_builder_st\Functional\Rest;
 use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
 
 /**
- * Class that extends the Resource Test Base Class.
- *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayJsonAnonTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php
index 18118cb..d1c3436 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php
@@ -5,8 +5,6 @@ namespace Drupal\Tests\layout_builder_st\Functional\Rest;
 use Drupal\Tests\rest\Functional\BasicAuthResourceTestTrait;
 
 /**
- * Class that extends the Display Resource Test Base class.
- *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayJsonBasicAuthTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php
index 2ba8be3..023e8d5 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php
@@ -5,8 +5,6 @@ namespace Drupal\Tests\layout_builder_st\Functional\Rest;
 use Drupal\Tests\rest\Functional\CookieResourceTestTrait;
 
 /**
- * Base class for performing the Json Cookie test.
- *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayJsonCookieTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php
index fa35e9b..314d714 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php
@@ -6,8 +6,6 @@ use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
 use Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait;
 
 /**
- * Base class for performing the XML Anon user test.
- *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayXmlAnonTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php
index 8d85437..7936779 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php
@@ -6,8 +6,6 @@ use Drupal\Tests\rest\Functional\BasicAuthResourceTestTrait;
 use Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait;
 
 /**
- * Base class for performing the XML Basic Auth test.
- *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayXmlBasicAuthTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php
index c686ef8..ebbee3b 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php
@@ -6,8 +6,6 @@ use Drupal\Tests\rest\Functional\CookieResourceTestTrait;
 use Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait;
 
 /**
- * Base class for performing the XML Cookie test.
- *
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayXmlCookieTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
-- 
GitLab


From 8a4b4b4188b6bb3cd43f34b345ade20b393e9d5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= <adam@phenaproxima.net>
Date: Wed, 2 Apr 2025 20:20:22 -0400
Subject: [PATCH 21/27] Use a damn decorator

---
 layout_builder_st.module                  | 15 +++++++++++--
 layout_builder_st.services.yml            | 13 ++++-------
 src/DependencyInjection/ClassResolver.php | 14 +++++++-----
 src/ElementManager.php                    | 27 -----------------------
 4 files changed, 26 insertions(+), 43 deletions(-)
 delete mode 100644 src/ElementManager.php

diff --git a/layout_builder_st.module b/layout_builder_st.module
index 60a6e10..34f03b4 100644
--- a/layout_builder_st.module
+++ b/layout_builder_st.module
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\layout_builder_st\Element\LayoutBuilder;
 use Drupal\layout_builder_st\Entity\LayoutBuilderEntityViewDisplay;
 use Drupal\layout_builder_st\Form\BlockContentInlineBlockTranslateForm;
 use Drupal\layout_builder\Form\OverridesEntityForm as CoreOverridesEntityForm;
@@ -17,7 +18,7 @@ use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
 /**
  * Implements hook_module_implements_alter().
  */
-function layout_builder_st_module_implements_alter(&$implementations, $hook): void {
+function layout_builder_st_module_implements_alter(array &$implementations, string $hook): void {
   switch ($hook) {
     // Move our hook_entity_type_alter() implementation to the end of the list.
     // it must run after layout_builder_st_entity_type_alter().
@@ -97,7 +98,17 @@ function layout_builder_st_field_widget_info_alter(array &$info): void {
  * Implements hook_modules_installed().
  */
 function layout_builder_st_modules_installed(array $modules): void {
-  if (in_array('layout_builder_at', $modules)) {
+  if (in_array('layout_builder_at', $modules, TRUE)) {
     \Drupal::messenger()->addError('Layout Builder Symmetric Translations is not compatible with Layout Builder Asymmetric Translations. One of these should be uninstalled');
   }
 }
+
+/**
+ * Implements hook_element_info_alter().
+ */
+function layout_builder_st_element_info_alter(array &$definitions): void {
+  if (isset($definitions['layout_builder'])) {
+    $definitions['layout_builder']['class'] = LayoutBuilder::class;
+    $definitions['layout_builder']['provider'] = 'layout_builder_st';
+  }
+}
diff --git a/layout_builder_st.services.yml b/layout_builder_st.services.yml
index fb1167d..0c6b90a 100644
--- a/layout_builder_st.services.yml
+++ b/layout_builder_st.services.yml
@@ -14,12 +14,7 @@ services:
     class: Drupal\layout_builder_st\Routing\RouteSubscriber
     tags:
       - { name: event_subscriber }
-  # Override the class resolver to so that InlineBlockEntityOperations can be swapped to the extend version.
-  class_resolver:
-    class: Drupal\layout_builder_st\DependencyInjection\ClassResolver
-    arguments: ['@service_container']
-  Drupal\Core\DependencyInjection\ClassResolverInterface: '@class_resolver'
-  plugin.manager.element_info:
-    class: Drupal\layout_builder_st\ElementManager
-    arguments: ['@container.namespaces', '@cache.discovery', '@theme_handler', '@module_handler', '@theme.manager']
-    Drupal\Core\Render\ElementInfoManagerInterface: '@plugin.manager.element_info'
+  Drupal\layout_builder_st\DependencyInjection\ClassResolver:
+    public: false
+    decorates: class_resolver
+    arguments: ['@.inner']
diff --git a/src/DependencyInjection/ClassResolver.php b/src/DependencyInjection/ClassResolver.php
index 6180256..7c69bbd 100644
--- a/src/DependencyInjection/ClassResolver.php
+++ b/src/DependencyInjection/ClassResolver.php
@@ -2,23 +2,27 @@
 
 namespace Drupal\layout_builder_st\DependencyInjection;
 
-use Drupal\Core\DependencyInjection\ClassResolver as CoreClassResolver;
+use Drupal\Core\DependencyInjection\ClassResolverInterface;
 use Drupal\layout_builder\InlineBlockEntityOperations as CoreInlineBlockEntityOperations;
 use Drupal\layout_builder_st\InlineBlockEntityOperations;
 
 /**
- * ClassResolver to load the extended InlineBlockEntityOperations class.
+ * Decorates the class resolver to load our InlineBlockEntityOperations class.
  */
-final class ClassResolver extends CoreClassResolver {
+final class ClassResolver implements ClassResolverInterface {
+
+  public function __construct(
+    private readonly ClassResolverInterface $decorated,
+  ) {}
 
   /**
    * {@inheritdoc}
    */
-  public function getInstanceFromDefinition($definition) {
+  public function getInstanceFromDefinition($definition): object {
     if ($definition === CoreInlineBlockEntityOperations::class) {
       $definition = InlineBlockEntityOperations::class;
     }
-    return parent::getInstanceFromDefinition($definition);
+    return $this->decorated->getInstanceFromDefinition($definition);
   }
 
 }
diff --git a/src/ElementManager.php b/src/ElementManager.php
deleted file mode 100644
index 88f5302..0000000
--- a/src/ElementManager.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-namespace Drupal\layout_builder_st;
-
-use Drupal\Core\Render\ElementInfoManager;
-use Drupal\layout_builder_st\Element\LayoutBuilder;
-
-/**
- * ElementManager extended to alter LayoutBuilder Element.
- *
- * @todo Remove if https://www.drupal.org/node/2987208 is fixed.
- */
-final class ElementManager extends ElementInfoManager {
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function alterDefinitions(&$definitions) {
-    parent::alterDefinitions($definitions);
-    // Replace LayoutBuilder element class.
-    if (isset($definitions['layout_builder'])) {
-      $definitions['layout_builder']['class'] = LayoutBuilder::class;
-      $definitions['layout_builder']['provider'] = 'layout_builder_st';
-    }
-  }
-
-}
-- 
GitLab


From 97c85602097f327d7623aad56e7994f9c49e0842 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= <adam@phenaproxima.net>
Date: Wed, 2 Apr 2025 20:37:16 -0400
Subject: [PATCH 22/27] Start cleaning up and fixing tests

---
 .../LayoutBuilderTranslationTest.php          | 20 ++++---------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/tests/src/Functional/LayoutBuilderTranslationTest.php b/tests/src/Functional/LayoutBuilderTranslationTest.php
index e76e0b3..7cd0705 100644
--- a/tests/src/Functional/LayoutBuilderTranslationTest.php
+++ b/tests/src/Functional/LayoutBuilderTranslationTest.php
@@ -80,16 +80,10 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session->pageTextNotContains('The translated field value');
     $assert_session->pageTextContains('The untranslated field value');
 
-    $add_block_text = 'Add block';
-    if (version_compare(\Drupal::VERSION, '8.8.0', '<')) {
-      $add_block_text = ucwords($add_block_text);
-    }
-
     // Adjust the layout of the original entity.
-    $assert_session->linkExists($add_block_text);
-    $this->clickLink($add_block_text);
+    $page->clickLink('Add block');
     $assert_session->linkExists('Powered by Drupal');
-    $this->clickLink('Powered by Drupal');
+    $page->clickLink('Powered by Drupal');
     $page->pressButton($add_block_text);
 
     $assert_session->pageTextContains('Powered by Drupal');
@@ -193,15 +187,9 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session->pageTextContains('The untranslated field value');
 
     $add_block_text = 'Add block';
-    if (version_compare(\Drupal::VERSION, '8.8.0', '<')) {
-      $add_block_text = ucwords($add_block_text);
-    }
-
     // Adjust the layout of the original entity.
-    $assert_session->linkExists($add_block_text);
-    $this->clickLink($add_block_text);
-    $assert_session->linkExists('Powered by Drupal');
-    $this->clickLink('Powered by Drupal');
+    $page->clickLink($add_block_text);
+    $page->clickLink('Powered by Drupal');
     $page->pressButton($add_block_text);
 
     $assert_session->pageTextContains('Powered by Drupal');
-- 
GitLab


From 3859291639c7f3189a9fbfc30c9b375653cff63b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= <adam@phenaproxima.net>
Date: Wed, 2 Apr 2025 21:07:47 -0400
Subject: [PATCH 23/27] Start fixing tests

---
 layout_builder_st.module                      | 16 ++---
 src/Element/LayoutBuilder.php                 | 64 ++-----------------
 src/Form/OverridesEntityForm.php              |  1 -
 .../OverridesSectionStorage.php               |  1 -
 .../LayoutBuilderTranslationTest.php          |  2 +-
 5 files changed, 15 insertions(+), 69 deletions(-)

diff --git a/layout_builder_st.module b/layout_builder_st.module
index 34f03b4..7de63c5 100644
--- a/layout_builder_st.module
+++ b/layout_builder_st.module
@@ -19,14 +19,12 @@ use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
  * Implements hook_module_implements_alter().
  */
 function layout_builder_st_module_implements_alter(array &$implementations, string $hook): void {
-  switch ($hook) {
+  if ($hook === 'entity_type_alter') {
     // Move our hook_entity_type_alter() implementation to the end of the list.
-    // it must run after layout_builder_st_entity_type_alter().
-    case 'entity_type_alter':
-      $group = $implementations['layout_builder_st'];
-      unset($implementations['layout_builder_st']);
-      $implementations['layout_builder_st'] = $group;
-      break;
+    // it must run after layout_builder_entity_type_alter().
+    $group = $implementations['layout_builder_st'];
+    unset($implementations['layout_builder_st']);
+    $implementations['layout_builder_st'] = $group;
   }
 }
 
@@ -104,9 +102,9 @@ function layout_builder_st_modules_installed(array $modules): void {
 }
 
 /**
- * Implements hook_element_info_alter().
+ * Implements hook_element_plugin_alter().
  */
-function layout_builder_st_element_info_alter(array &$definitions): void {
+function layout_builder_st_element_plugin_alter(array &$definitions): void {
   if (isset($definitions['layout_builder'])) {
     $definitions['layout_builder']['class'] = LayoutBuilder::class;
     $definitions['layout_builder']['provider'] = 'layout_builder_st';
diff --git a/src/Element/LayoutBuilder.php b/src/Element/LayoutBuilder.php
index c54915e..575b93c 100644
--- a/src/Element/LayoutBuilder.php
+++ b/src/Element/LayoutBuilder.php
@@ -2,14 +2,11 @@
 
 namespace Drupal\layout_builder_st\Element;
 
-use Drupal\Component\Plugin\ConfigurableInterface;
 use Drupal\Component\Plugin\DerivativeInspectionInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Render\Element;
 use Drupal\layout_builder\Element\LayoutBuilder as CoreLayoutBuilder;
-use Drupal\layout_builder\SectionComponent;
 use Drupal\layout_builder\SectionStorageInterface;
-use Drupal\layout_builder_st\LayoutBuilderTranslatablePluginInterface;
 use Drupal\layout_builder_st\TranslationsHelperTrait;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -20,42 +17,23 @@ final class LayoutBuilder extends CoreLayoutBuilder {
 
   use TranslationsHelperTrait;
 
-  /**
-   * The entity type manager.
-   *
-   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
-   */
-  protected $entityTypeManager;
-
-  /**
-   * Constructs a new LayoutBuilder.
-   *
-   * @param array $configuration
-   *   A configuration array containing information about the plugin instance.
-   * @param string $plugin_id
-   *   The plugin ID for the plugin instance.
-   * @param mixed $plugin_definition
-   *   The plugin implementation definition.
-   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
-   *   The event dispatcher service.
-   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
-   *   The entity type manager.
-   */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, $event_dispatcher, EntityTypeManagerInterface $entity_type_manager) {
-    parent::__construct($configuration, $plugin_id, $plugin_definition, $event_dispatcher);
-    $this->entityTypeManager = $entity_type_manager;
+  public function __construct(
+    private readonly EntityTypeManagerInterface $entityTypeManager,
+    mixed ...$arguments,
+  ) {
+    parent::__construct(...$arguments);
   }
 
   /**
    * {@inheritdoc}
    */
-  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): self {
     return new static(
+      $container->get(EntityTypeManagerInterface::class),
       $configuration,
       $plugin_id,
       $plugin_definition,
       $container->get('event_dispatcher'),
-      $container->get('entity_type.manager')
     );
   }
 
@@ -168,32 +146,4 @@ final class LayoutBuilder extends CoreLayoutBuilder {
     ];
   }
 
-  /**
-   * Determines whether the component has translatable configuration.
-   *
-   * This function is replacement for the method:
-   * \Drupal\layout_builder\SectionComponent::hasTranslatableConfiguration()
-   * Read: https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
-   * This avoids having to alter the class in the module.
-   *
-   * @param \Drupal\layout_builder\SectionComponent $component
-   *   The section component of the Layout Builder.
-   *
-   * @return bool
-   *   TRUE if the plugin has translatable configuration.
-   */
-  private static function hasTranslatableConfiguration(SectionComponent $component) {
-    $plugin = $component->getPlugin();
-    if ($plugin instanceof LayoutBuilderTranslatablePluginInterface) {
-      return $plugin->hasTranslatableConfiguration();
-    }
-    elseif ($plugin instanceof ConfigurableInterface) {
-      // For all plugins that do not implement
-      // LayoutBuilderTranslatablePluginInterface only allow label translation.
-      $configuration = $plugin->getConfiguration();
-      return !empty($configuration['label_display']) && !empty($configuration['label']);
-    }
-    return FALSE;
-  }
-
 }
diff --git a/src/Form/OverridesEntityForm.php b/src/Form/OverridesEntityForm.php
index 94e11da..485e446 100644
--- a/src/Form/OverridesEntityForm.php
+++ b/src/Form/OverridesEntityForm.php
@@ -22,7 +22,6 @@ final class OverridesEntityForm extends CoreOverridesEntityForm {
     $form = parent::buildForm($form, $form_state, $section_storage);
     $form[OverridesSectionStorage::TRANSLATED_CONFIGURATION_FIELD_NAME]['#access'] = TRUE;
     return $form;
-
   }
 
   /**
diff --git a/src/Plugin/SectionStorage/OverridesSectionStorage.php b/src/Plugin/SectionStorage/OverridesSectionStorage.php
index d56f377..6e85c03 100644
--- a/src/Plugin/SectionStorage/OverridesSectionStorage.php
+++ b/src/Plugin/SectionStorage/OverridesSectionStorage.php
@@ -13,7 +13,6 @@ use Drupal\layout_builder_st\TranslatableSectionStorageInterface;
  */
 final class OverridesSectionStorage extends CoreOverridesSectionStorage implements TranslatableSectionStorageInterface {
 
-
   /**
    * The field name for translated configuration used by this storage.
    *
diff --git a/tests/src/Functional/LayoutBuilderTranslationTest.php b/tests/src/Functional/LayoutBuilderTranslationTest.php
index 7cd0705..4c8a691 100644
--- a/tests/src/Functional/LayoutBuilderTranslationTest.php
+++ b/tests/src/Functional/LayoutBuilderTranslationTest.php
@@ -84,7 +84,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $page->clickLink('Add block');
     $assert_session->linkExists('Powered by Drupal');
     $page->clickLink('Powered by Drupal');
-    $page->pressButton($add_block_text);
+    $page->pressButton('Add block');
 
     $assert_session->pageTextContains('Powered by Drupal');
 
-- 
GitLab


From be640a3790d4c7cb34b9720ce29b599b5a178ad9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= <adam@phenaproxima.net>
Date: Wed, 2 Apr 2025 21:18:50 -0400
Subject: [PATCH 24/27] Add DependencySerializationTrait to LayoutBuilder
 element

---
 src/Element/LayoutBuilder.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/Element/LayoutBuilder.php b/src/Element/LayoutBuilder.php
index 575b93c..a7ee182 100644
--- a/src/Element/LayoutBuilder.php
+++ b/src/Element/LayoutBuilder.php
@@ -3,6 +3,7 @@
 namespace Drupal\layout_builder_st\Element;
 
 use Drupal\Component\Plugin\DerivativeInspectionInterface;
+use Drupal\Core\DependencyInjection\DependencySerializationTrait;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Render\Element;
 use Drupal\layout_builder\Element\LayoutBuilder as CoreLayoutBuilder;
@@ -15,6 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  */
 final class LayoutBuilder extends CoreLayoutBuilder {
 
+  use DependencySerializationTrait;
   use TranslationsHelperTrait;
 
   public function __construct(
-- 
GitLab


From 646923c52860c77423fa91503c924eb64f422251 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= <adam@phenaproxima.net>
Date: Wed, 2 Apr 2025 21:26:02 -0400
Subject: [PATCH 25/27] Revert needless changes

---
 .../Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php          | 1 +
 .../Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php     | 1 +
 .../Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php        | 1 +
 .../Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php           | 1 +
 .../Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php      | 1 +
 .../Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php         | 1 +
 6 files changed, 6 insertions(+)

diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php
index 83bd98d..99c1573 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php
@@ -5,6 +5,7 @@ namespace Drupal\Tests\layout_builder_st\Functional\Rest;
 use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
 
 /**
+ * @group layout_builder
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayJsonAnonTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php
index d1c3436..c3ec00e 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php
@@ -5,6 +5,7 @@ namespace Drupal\Tests\layout_builder_st\Functional\Rest;
 use Drupal\Tests\rest\Functional\BasicAuthResourceTestTrait;
 
 /**
+ * @group layout_builder
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayJsonBasicAuthTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php
index 023e8d5..fe2e975 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php
@@ -5,6 +5,7 @@ namespace Drupal\Tests\layout_builder_st\Functional\Rest;
 use Drupal\Tests\rest\Functional\CookieResourceTestTrait;
 
 /**
+ * @group layout_builder
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayJsonCookieTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php
index 314d714..7a42c01 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php
@@ -6,6 +6,7 @@ use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
 use Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait;
 
 /**
+ * @group layout_builder
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayXmlAnonTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php
index 7936779..9ecbb28 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php
@@ -6,6 +6,7 @@ use Drupal\Tests\rest\Functional\BasicAuthResourceTestTrait;
 use Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait;
 
 /**
+ * @group layout_builder
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayXmlBasicAuthTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
diff --git a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php
index ebbee3b..64546fb 100644
--- a/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php
+++ b/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php
@@ -6,6 +6,7 @@ use Drupal\Tests\rest\Functional\CookieResourceTestTrait;
 use Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait;
 
 /**
+ * @group layout_builder
  * @group rest
  */
 class LayoutBuilderEntityViewDisplayXmlCookieTest extends LayoutBuilderEntityViewDisplayResourceTestBase {
-- 
GitLab


From 35f35a16096bf6ddeddbfa4229f3f28386c5cb97 Mon Sep 17 00:00:00 2001
From: "joseph.olstad" <joseph.olstad@1321830.no-reply.drupal.org>
Date: Wed, 23 Apr 2025 13:13:25 -0400
Subject: [PATCH 26/27] Issue #3497945 by liam morland, joseph.olstad,
 phenaproxima, danrod: A functional d11 build of layout_builder_st.

---
 layout_builder_st.info.yml                    |   2 +-
 layout_builder_st.install                     |  34 +++--
 layout_builder_st.libraries.yml               |   5 +
 layout_builder_st.links.contextual.yml        |   1 +
 layout_builder_st.module                      |  53 ++++----
 layout_builder_st.services.yml                |  14 +-
 src/DependencyInjection/ClassResolver.php     |  18 +--
 src/Element/LayoutBuilder.php                 |  77 +++++++++--
 src/ElementManager.php                        |  27 ++++
 .../ComponentPluginTranslate.php              |   9 +-
 src/Field/LayoutTranslationItemList.php       |   5 +-
 .../BlockContentInlineBlockTranslateForm.php  |   2 +-
 src/Form/OverridesEntityForm.php              |   7 +-
 src/Form/TranslateBlockForm.php               |   8 +-
 src/InlineBlockEntityOperations.php           |   5 +-
 src/LayoutBuilderStServiceProvider.php        |   3 -
 src/Plugin/Block/InlineBlock.php              |   1 +
 .../OverridesSectionStorage.php               |  20 ++-
 src/ResourceTypeRepository.php                |   3 -
 src/TranslationsHelperTrait.php               |   5 +-
 .../LayoutBuilderTranslationTest.php          | 122 +++++++++++++++---
 .../Functional/Rest/OverrideSectionsTest.php  |  16 +--
 .../InlineBlockTranslationTest.php            |   4 +-
 .../JavascriptTranslationTestTrait.php        |   4 +-
 .../LayoutBuilderTestTrait.php                |   2 +-
 .../FunctionalJavascript/TranslationTest.php  |   5 +-
 26 files changed, 313 insertions(+), 139 deletions(-)
 create mode 100644 layout_builder_st.libraries.yml
 create mode 100644 src/ElementManager.php

diff --git a/layout_builder_st.info.yml b/layout_builder_st.info.yml
index 8e1f02d..7643a14 100644
--- a/layout_builder_st.info.yml
+++ b/layout_builder_st.info.yml
@@ -2,6 +2,6 @@ name: 'Layout Builder Symmetric Translations'
 type: module
 description: 'Allows translating Layout overrides'
 package: Layout Builder
-core_version_requirement: ^10 || ^11
+core_version_requirement: ^9.5 || ^10.2 || ^11
 dependencies:
   - drupal:layout_builder
diff --git a/layout_builder_st.install b/layout_builder_st.install
index bb99fcc..10bc99a 100644
--- a/layout_builder_st.install
+++ b/layout_builder_st.install
@@ -1,14 +1,10 @@
 <?php
 
-/**
- * @file
- * Contains installation and update hooks for layout_builder_st.
- */
-
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
 
+
 /**
  * Implements hook_install().
  */
@@ -18,15 +14,21 @@ function layout_builder_st_install() {
   $field_manager = \Drupal::service('entity_field.manager');
   $field_map = $field_manager->getFieldMap();
   foreach ($field_map as $entity_type_id => $field_infos) {
-    foreach ($field_infos[OverridesSectionStorage::FIELD_NAME]['bundles'] ?? [] as $bundle) {
-      // The field map can contain stale information. If the field does not
-      // exist, ignore it. The field map will be rebuilt when the cache is
-      // cleared at the end of the update process.
-      if (!FieldConfig::loadByName($entity_type_id, $bundle, OverridesSectionStorage::FIELD_NAME)) {
-        continue;
+    if (isset($field_infos[\Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::FIELD_NAME]['bundles'])) {
+      $non_translatable_bundle_count = 0;
+      foreach ($field_infos[OverridesSectionStorage::FIELD_NAME]['bundles'] as $bundle) {
+        $bundles_not_added = [];
+        // The field map can contain stale information. If the field does not
+        // exist, ignore it. The field map will be rebuilt when the cache is
+        // cleared at the end of the update process.
+        if (!$field_config = FieldConfig::loadByName($entity_type_id, $bundle, OverridesSectionStorage::FIELD_NAME)) {
+          continue;
+        }
+        _layout_builder_st_add_translation_field($entity_type_id, $bundle);
+
       }
-      _layout_builder_st_add_translation_field($entity_type_id, $bundle);
     }
+
   }
 }
 
@@ -63,6 +65,7 @@ function _layout_builder_st_add_translation_field($entity_type_id, $bundle) {
   }
 }
 
+
 /**
  * Implements hook_requirements().
  */
@@ -84,3 +87,10 @@ function layout_builder_st_requirements($phase) {
 
   return $requirements;
 }
+
+/**
+ * Rebuilding container, because of D11 related services.yml changes.
+ */
+function layout_builder_st_update_10001() {
+  \Drupal::service('kernel')->rebuildContainer();
+}
diff --git a/layout_builder_st.libraries.yml b/layout_builder_st.libraries.yml
new file mode 100644
index 0000000..9877da7
--- /dev/null
+++ b/layout_builder_st.libraries.yml
@@ -0,0 +1,5 @@
+contextual:
+  js:
+    js/contextual.js: {}
+  dependencies:
+    - core/jquery
diff --git a/layout_builder_st.links.contextual.yml b/layout_builder_st.links.contextual.yml
index e2a31ff..a23b0c4 100644
--- a/layout_builder_st.links.contextual.yml
+++ b/layout_builder_st.links.contextual.yml
@@ -17,3 +17,4 @@ layout_builder_inline_block_translate:
       class: ['use-ajax']
       data-dialog-type: dialog
       data-dialog-renderer: off_canvas
+
diff --git a/layout_builder_st.module b/layout_builder_st.module
index 7de63c5..5fbfe61 100644
--- a/layout_builder_st.module
+++ b/layout_builder_st.module
@@ -1,39 +1,40 @@
 <?php
 
-/**
- * @file
- * Contains hook implementations for layout_builder_st.
- */
-
+use Drupal\Component\Plugin\ConfigurableInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
-use Drupal\layout_builder_st\Element\LayoutBuilder;
 use Drupal\layout_builder_st\Entity\LayoutBuilderEntityViewDisplay;
 use Drupal\layout_builder_st\Form\BlockContentInlineBlockTranslateForm;
 use Drupal\layout_builder\Form\OverridesEntityForm as CoreOverridesEntityForm;
+use Drupal\layout_builder_st\Form\BlockPluginTranslationForm;
 use Drupal\layout_builder_st\Form\OverridesEntityForm;
 use Drupal\layout_builder_st\Plugin\Block\InlineBlock;
 use Drupal\layout_builder_st\Plugin\Field\FieldWidget\LayoutBuilderWidget;
 use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
 
+
 /**
  * Implements hook_module_implements_alter().
  */
-function layout_builder_st_module_implements_alter(array &$implementations, string $hook): void {
-  if ($hook === 'entity_type_alter') {
+function layout_builder_st_module_implements_alter(&$implementations, $hook) {
+  switch ($hook) {
     // Move our hook_entity_type_alter() implementation to the end of the list.
-    // it must run after layout_builder_entity_type_alter().
-    $group = $implementations['layout_builder_st'];
-    unset($implementations['layout_builder_st']);
-    $implementations['layout_builder_st'] = $group;
+    // it must run after layout_builder_st_entity_type_alter().
+    case 'entity_type_alter':
+      $group = $implementations['layout_builder_st'];
+      unset($implementations['layout_builder_st']);
+      $implementations['layout_builder_st'] = $group;
+      break;
   }
 }
 
+
 /**
  * Implements hook_entity_type_alter().
  *
- * @see https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
+ * Copied from https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
  */
-function layout_builder_st_entity_type_alter(array &$entity_types): void {
+function layout_builder_st_entity_type_alter(array &$entity_types) {
+
   // Replace entity_view_display class with our own.
   /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['entity_view_display']
@@ -64,9 +65,9 @@ function layout_builder_st_entity_type_alter(array &$entity_types): void {
 /**
  * Implements hook_block_alter().
  */
-function layout_builder_st_block_alter(array &$definitions): void {
+function layout_builder_st_block_alter(&$definitions) {
   foreach ($definitions as &$definition) {
-    if ($definition['id'] === 'inline_block') {
+    if ($definition['id']  === 'inline_block') {
       // Replace with our extended InlineBlock class to handle translations.
       $definition['class'] = InlineBlock::class;
     }
@@ -75,8 +76,10 @@ function layout_builder_st_block_alter(array &$definitions): void {
 
 /**
  * Implements hook_layout_builder_section_storage_alter().
+ *
+ * @param \Drupal\layout_builder\SectionStorage\SectionStorageDefinition[] $definitions
  */
-function layout_builder_st_layout_builder_section_storage_alter(array &$definitions): void {
+function layout_builder_st_layout_builder_section_storage_alter(array &$definitions) {
   $definition = $definitions['overrides'];
   $definition->setClass(OverridesSectionStorage::class);
 }
@@ -84,7 +87,7 @@ function layout_builder_st_layout_builder_section_storage_alter(array &$definiti
 /**
  * Implements hook_field_widget_info_alter().
  */
-function layout_builder_st_field_widget_info_alter(array &$info): void {
+function layout_builder_st_field_widget_info_alter(array &$info) {
   if (isset($info['layout_builder_widget'])) {
     $info['layout_builder_widget']['field_types'][] = 'layout_translation';
     $info['layout_builder_widget']['class'] = LayoutBuilderWidget::class;
@@ -95,18 +98,8 @@ function layout_builder_st_field_widget_info_alter(array &$info): void {
 /**
  * Implements hook_modules_installed().
  */
-function layout_builder_st_modules_installed(array $modules): void {
-  if (in_array('layout_builder_at', $modules, TRUE)) {
+function layout_builder_st_modules_installed($modules) {
+  if (in_array('layout_builder_at', $modules)) {
     \Drupal::messenger()->addError('Layout Builder Symmetric Translations is not compatible with Layout Builder Asymmetric Translations. One of these should be uninstalled');
   }
 }
-
-/**
- * Implements hook_element_plugin_alter().
- */
-function layout_builder_st_element_plugin_alter(array &$definitions): void {
-  if (isset($definitions['layout_builder'])) {
-    $definitions['layout_builder']['class'] = LayoutBuilder::class;
-    $definitions['layout_builder']['provider'] = 'layout_builder_st';
-  }
-}
diff --git a/layout_builder_st.services.yml b/layout_builder_st.services.yml
index 0c6b90a..ae9288e 100644
--- a/layout_builder_st.services.yml
+++ b/layout_builder_st.services.yml
@@ -14,7 +14,13 @@ services:
     class: Drupal\layout_builder_st\Routing\RouteSubscriber
     tags:
       - { name: event_subscriber }
-  Drupal\layout_builder_st\DependencyInjection\ClassResolver:
-    public: false
-    decorates: class_resolver
-    arguments: ['@.inner']
+
+  # Override the class resolver to so that InlineBlockEntityOperations can be swapped to the extend version.
+  class_resolver:
+    class: Drupal\layout_builder_st\DependencyInjection\ClassResolver
+    arguments: ['@service_container']
+  Drupal\Core\DependencyInjection\ClassResolverInterface: '@class_resolver'
+  plugin.manager.element_info:
+    class: Drupal\layout_builder_st\ElementManager
+    arguments: ['@container.namespaces', '@cache.discovery', '@theme_handler', '@module_handler', '@theme.manager']
+  Drupal\Core\Render\ElementInfoManagerInterface: '@plugin.manager.element_info'
diff --git a/src/DependencyInjection/ClassResolver.php b/src/DependencyInjection/ClassResolver.php
index 7c69bbd..675e8b9 100644
--- a/src/DependencyInjection/ClassResolver.php
+++ b/src/DependencyInjection/ClassResolver.php
@@ -2,27 +2,21 @@
 
 namespace Drupal\layout_builder_st\DependencyInjection;
 
-use Drupal\Core\DependencyInjection\ClassResolverInterface;
+use Drupal\Core\DependencyInjection\ClassResolver as CoreClassResolver;
 use Drupal\layout_builder\InlineBlockEntityOperations as CoreInlineBlockEntityOperations;
 use Drupal\layout_builder_st\InlineBlockEntityOperations;
 
 /**
- * Decorates the class resolver to load our InlineBlockEntityOperations class.
+ * ClassResolver to load the extended InlineBlockEntityOperations class.
  */
-final class ClassResolver implements ClassResolverInterface {
+final class ClassResolver extends CoreClassResolver {
 
-  public function __construct(
-    private readonly ClassResolverInterface $decorated,
-  ) {}
-
-  /**
-   * {@inheritdoc}
-   */
-  public function getInstanceFromDefinition($definition): object {
+  public function getInstanceFromDefinition($definition) {
     if ($definition === CoreInlineBlockEntityOperations::class) {
       $definition = InlineBlockEntityOperations::class;
     }
-    return $this->decorated->getInstanceFromDefinition($definition);
+    return parent::getInstanceFromDefinition($definition);
   }
 
+
 }
diff --git a/src/Element/LayoutBuilder.php b/src/Element/LayoutBuilder.php
index a7ee182..eb8f2d5 100644
--- a/src/Element/LayoutBuilder.php
+++ b/src/Element/LayoutBuilder.php
@@ -2,11 +2,12 @@
 
 namespace Drupal\layout_builder_st\Element;
 
+use Drupal\Component\Plugin\ConfigurableInterface;
 use Drupal\Component\Plugin\DerivativeInspectionInterface;
-use Drupal\Core\DependencyInjection\DependencySerializationTrait;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Render\Element;
 use Drupal\layout_builder\Element\LayoutBuilder as CoreLayoutBuilder;
+use Drupal\layout_builder\SectionComponent;
 use Drupal\layout_builder\SectionStorageInterface;
 use Drupal\layout_builder_st\TranslationsHelperTrait;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -16,29 +17,57 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  */
 final class LayoutBuilder extends CoreLayoutBuilder {
 
-  use DependencySerializationTrait;
   use TranslationsHelperTrait;
 
-  public function __construct(
-    private readonly EntityTypeManagerInterface $entityTypeManager,
-    mixed ...$arguments,
-  ) {
-    parent::__construct(...$arguments);
+  /**
+   * The entity type manager.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
+   */
+  protected $entityTypeManager;
+
+  /**
+   * Constructs a new LayoutBuilder.
+   *
+   * @param array $configuration
+   *   A configuration array containing information about the plugin instance.
+   * @param string $plugin_id
+   *   The plugin ID for the plugin instance.
+   * @param mixed $plugin_definition
+   *   The plugin implementation definition.
+   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
+   *   The event dispatcher service.
+   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
+   *   The entity type manager.
+   */
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, $event_dispatcher, EntityTypeManagerInterface $entity_type_manager) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition, $event_dispatcher);
+    $this->entityTypeManager = $entity_type_manager;
   }
 
   /**
    * {@inheritdoc}
    */
-  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): self {
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
     return new static(
-      $container->get(EntityTypeManagerInterface::class),
       $configuration,
       $plugin_id,
       $plugin_definition,
       $container->get('event_dispatcher'),
+      $container->get('entity_type.manager')
     );
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  protected function layout(SectionStorageInterface $section_storage) {
+    $output = parent::layout($section_storage);
+    $output['#attached']['library'][] = 'layout_builder_st/contextual';
+
+    return $output;
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -93,12 +122,14 @@ final class LayoutBuilder extends CoreLayoutBuilder {
    *
    * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
    *   The section storage.
-   * @param string $delta
+   * @param $delta
    *   The section delta.
-   * @param string $region
+   * @param $region
    *   The region.
-   * @param string $uuid
+   * @param $uuid
    *   The UUID of the component.
+   * @param $is_translation
+   *   Whether the section storage is handling a translation.
    *
    * @return array|null
    *   The contextual link render array or NULL if none.
@@ -148,4 +179,26 @@ final class LayoutBuilder extends CoreLayoutBuilder {
     ];
   }
 
+  /**
+   * Determines whether the component has translatable configuration.
+   *
+   * This function is replacement for \Drupal\layout_builder\SectionComponent::hasTranslatableConfiguration()
+   * in https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
+   * This avoids having to alter the class in the module.
+   *
+   * @param \Drupal\layout_builder\SectionComponent $component
+   *
+   * @return bool
+   *   TRUE if the plugin has translatable configuration.
+   */
+  private static function hasTranslatableConfiguration(SectionComponent $component) {
+    $plugin = $component->getPlugin();
+    if ($plugin instanceof ConfigurableInterface) {
+      // For all plugins of ConfigurableInterface, only allow label translation.
+      $configuration = $plugin->getConfiguration();
+      return !empty($configuration['label_display']) && !empty($configuration['label']);
+    }
+    return FALSE;
+  }
+
 }
diff --git a/src/ElementManager.php b/src/ElementManager.php
new file mode 100644
index 0000000..88f5302
--- /dev/null
+++ b/src/ElementManager.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Drupal\layout_builder_st;
+
+use Drupal\Core\Render\ElementInfoManager;
+use Drupal\layout_builder_st\Element\LayoutBuilder;
+
+/**
+ * ElementManager extended to alter LayoutBuilder Element.
+ *
+ * @todo Remove if https://www.drupal.org/node/2987208 is fixed.
+ */
+final class ElementManager extends ElementInfoManager {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function alterDefinitions(&$definitions) {
+    parent::alterDefinitions($definitions);
+    // Replace LayoutBuilder element class.
+    if (isset($definitions['layout_builder'])) {
+      $definitions['layout_builder']['class'] = LayoutBuilder::class;
+      $definitions['layout_builder']['provider'] = 'layout_builder_st';
+    }
+  }
+
+}
diff --git a/src/EventSubscriber/ComponentPluginTranslate.php b/src/EventSubscriber/ComponentPluginTranslate.php
index e68d598..1253940 100644
--- a/src/EventSubscriber/ComponentPluginTranslate.php
+++ b/src/EventSubscriber/ComponentPluginTranslate.php
@@ -20,7 +20,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 final class ComponentPluginTranslate implements EventSubscriberInterface {
 
   use LayoutEntityHelperTrait;
-  // This trait will be merged into core's.
+  //  This trait will be merged into core's.
   use TranslationsHelperTrait;
 
   /**
@@ -51,7 +51,10 @@ final class ComponentPluginTranslate implements EventSubscriberInterface {
   }
 
   /**
-   * {@inheritdoc}
+   * Returns a list of subscribed events.
+   * 
+   * @return array
+   *  This returns an array of the subscribed events.
    */
   public static function getSubscribedEvents() {
     $events[LayoutBuilderEvents::SECTION_COMPONENT_BUILD_RENDER_ARRAY] = ['onBuildRender', 200];
@@ -87,7 +90,7 @@ final class ComponentPluginTranslate implements EventSubscriberInterface {
 
     if (static::isTranslation($section_storage)) {
       if ($translated_plugin_configuration = $section_storage->getTranslatedComponentConfiguration($component->getUuid())) {
-        $translated_plugin_configuration += $configuration;
+        $translated_plugin_configuration = array_replace_recursive($configuration, $translated_plugin_configuration);
         $plugin->setConfiguration($translated_plugin_configuration);
       }
     }
diff --git a/src/Field/LayoutTranslationItemList.php b/src/Field/LayoutTranslationItemList.php
index 93b05d0..a6e8952 100644
--- a/src/Field/LayoutTranslationItemList.php
+++ b/src/Field/LayoutTranslationItemList.php
@@ -6,9 +6,6 @@ use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Field\FieldItemList;
 use Drupal\Core\Session\AccountInterface;
 
-/**
- * A list of layout translation items.
- */
 final class LayoutTranslationItemList extends FieldItemList {
 
   /**
@@ -16,7 +13,7 @@ final class LayoutTranslationItemList extends FieldItemList {
    *
    * @ingroup layout_builder_access
    */
-  public function defaultAccess($operation = 'view', ?AccountInterface $account = NULL) {
+  public function defaultAccess($operation = 'view', AccountInterface $account = NULL) {
     // @todo Allow access in https://www.drupal.org/node/2942975.
     return AccessResult::forbidden();
   }
diff --git a/src/Form/BlockContentInlineBlockTranslateForm.php b/src/Form/BlockContentInlineBlockTranslateForm.php
index b6bb0b1..5af2b7d 100644
--- a/src/Form/BlockContentInlineBlockTranslateForm.php
+++ b/src/Form/BlockContentInlineBlockTranslateForm.php
@@ -50,7 +50,7 @@ final class BlockContentInlineBlockTranslateForm extends BlockContentForm {
   /**
    * {@inheritdoc}
    */
-  public function __construct(EntityRepositoryInterface $entity_repository, ?EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, ?TimeInterface $time = NULL, ?RouteMatchInterface $route_match = NULL, ?LayoutTempstoreRepositoryInterface $tempstore = NULL) {
+  public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL, RouteMatchInterface $route_match = NULL, LayoutTempstoreRepositoryInterface $tempstore = NULL) {
     parent::__construct($entity_repository, $entity_type_bundle_info, $time);
     $this->routeMatch = $route_match;
     $this->layoutTempstoreRepository = $tempstore;
diff --git a/src/Form/OverridesEntityForm.php b/src/Form/OverridesEntityForm.php
index 485e446..8ff3595 100644
--- a/src/Form/OverridesEntityForm.php
+++ b/src/Form/OverridesEntityForm.php
@@ -9,7 +9,7 @@ use Drupal\layout_builder\SectionStorageInterface;
 use Drupal\layout_builder_st\TranslationsHelperTrait;
 
 /**
- * This class extends core class OverridesEntityForm.
+ * Extended OverridesEntityForm
  */
 final class OverridesEntityForm extends CoreOverridesEntityForm {
 
@@ -18,10 +18,11 @@ final class OverridesEntityForm extends CoreOverridesEntityForm {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, FormStateInterface $form_state, ?SectionStorageInterface $section_storage = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL) {
     $form = parent::buildForm($form, $form_state, $section_storage);
     $form[OverridesSectionStorage::TRANSLATED_CONFIGURATION_FIELD_NAME]['#access'] = TRUE;
     return $form;
+
   }
 
   /**
@@ -50,7 +51,7 @@ final class OverridesEntityForm extends CoreOverridesEntityForm {
    */
   protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
-    if (static::isTranslation($this->sectionStorage)) {
+    if(static::isTranslation($this->sectionStorage)) {
       unset($actions['revert']);
     }
     return $actions;
diff --git a/src/Form/TranslateBlockForm.php b/src/Form/TranslateBlockForm.php
index a5faee8..88d0086 100644
--- a/src/Form/TranslateBlockForm.php
+++ b/src/Form/TranslateBlockForm.php
@@ -57,8 +57,6 @@ class TranslateBlockForm extends FormBase {
   protected $moduleHandler;
 
   /**
-   * The typed config manager.
-   *
    * @var \Drupal\Core\Config\TypedConfigManagerInterface
    */
   protected $typedConfigManager;
@@ -109,7 +107,7 @@ class TranslateBlockForm extends FormBase {
    * @return array
    *   The form array.
    */
-  public function buildForm(array $form, FormStateInterface $form_state, ?TranslatableSectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $uuid = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, TranslatableSectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $uuid = NULL) {
     $component = $section_storage->getSection($delta)->getComponent($uuid);
 
     $this->sectionStorage = $section_storage;
@@ -181,13 +179,13 @@ class TranslateBlockForm extends FormBase {
         $element_build['label']['source'] = [
           '#type' => 'item',
           '#title' => $this->t('Label'),
-          '#markup' => $label_data->getValue() ?: '(' . $this->t('Empty') . ')',
+          '#markup' => $label_data->getValue()?: '(' . $this->t('Empty') . ')',
           '#parents' => ['source', 'label'],
         ];
         $element_build['label']['translation'] = [
           '#type' => 'textfield',
           '#title' => $this->t('Label'),
-          '#default_value' => $translated_configuration['label'] ?? '',
+          '#default_value' => isset($translated_configuration['label']) ? $translated_configuration['label'] : '',
           '#parents' => ['translation', 'label'],
         ];
       }
diff --git a/src/InlineBlockEntityOperations.php b/src/InlineBlockEntityOperations.php
index 3673a60..b4257e9 100644
--- a/src/InlineBlockEntityOperations.php
+++ b/src/InlineBlockEntityOperations.php
@@ -7,9 +7,7 @@ use Drupal\layout_builder\InlineBlockEntityOperations as CoreInlineBlockEntityOp
 use Drupal\layout_builder\SectionComponent;
 
 /**
- * This class overrides core InlineBlockEntityOperations.
- *
- * This was implemented to provide translation operations.
+ * Overrides cores InlineBlockEntityOperations to provide translation operations.
  */
 final class InlineBlockEntityOperations extends CoreInlineBlockEntityOperations {
 
@@ -69,4 +67,5 @@ final class InlineBlockEntityOperations extends CoreInlineBlockEntityOperations
 
   }
 
+
 }
diff --git a/src/LayoutBuilderStServiceProvider.php b/src/LayoutBuilderStServiceProvider.php
index 3ee2f99..d079ce6 100644
--- a/src/LayoutBuilderStServiceProvider.php
+++ b/src/LayoutBuilderStServiceProvider.php
@@ -5,9 +5,6 @@ namespace Drupal\layout_builder_st;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceProviderBase;
 
-/**
- * Overrides core services.
- */
 class LayoutBuilderStServiceProvider extends ServiceProviderBase {
 
   /**
diff --git a/src/Plugin/Block/InlineBlock.php b/src/Plugin/Block/InlineBlock.php
index 3f2d4d1..6dd5385 100644
--- a/src/Plugin/Block/InlineBlock.php
+++ b/src/Plugin/Block/InlineBlock.php
@@ -28,4 +28,5 @@ final class InlineBlock extends CoreInlineBlock {
     return $form;
   }
 
+
 }
diff --git a/src/Plugin/SectionStorage/OverridesSectionStorage.php b/src/Plugin/SectionStorage/OverridesSectionStorage.php
index 6e85c03..02a187b 100644
--- a/src/Plugin/SectionStorage/OverridesSectionStorage.php
+++ b/src/Plugin/SectionStorage/OverridesSectionStorage.php
@@ -8,11 +8,9 @@ use Drupal\Core\Session\AccountInterface;
 use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage as CoreOverridesSectionStorage;
 use Drupal\layout_builder_st\TranslatableSectionStorageInterface;
 
-/**
- * {@inheritdoc}
- */
 final class OverridesSectionStorage extends CoreOverridesSectionStorage implements TranslatableSectionStorageInterface {
 
+
   /**
    * The field name for translated configuration used by this storage.
    *
@@ -25,12 +23,22 @@ final class OverridesSectionStorage extends CoreOverridesSectionStorage implemen
    */
   protected function handleTranslationAccess(AccessResult $result, $operation, AccountInterface $account) {
     $entity = $this->getEntity();
+
+    // Check if the entity is not null and allows overrides before accessing its properties.
+    if (!$entity || !$entity->hasField(static::FIELD_NAME)) {
+      // Return a neutral result if the entity is null.
+      return AccessResult::neutral();
+    }
+
     $field_config = $entity->getFieldDefinition(static::FIELD_NAME)->getConfig($entity->bundle());
-    // Access is allow if one of the following conditions is true:
+
+    // Access is allowed if one of the following conditions is true:
     // 1. This is the default translation.
     // 2. The entity is translatable and the layout is overridden and the layout
     //    field is not translatable.
-    return $result->andIf(AccessResult::allowedIf($this->isDefaultTranslation() || ($entity instanceof TranslatableInterface && $this->isOverridden() && !$field_config->isTranslatable())))->addCacheableDependency($entity)->addCacheableDependency($field_config);
+    return $result->andIf(AccessResult::allowedIf($this->isDefaultTranslation() || ($entity instanceof TranslatableInterface && $this->isOverridden() && !$field_config->isTranslatable())))
+      ->addCacheableDependency($entity)
+      ->addCacheableDependency($field_config);
   }
 
   /**
@@ -78,7 +86,7 @@ final class OverridesSectionStorage extends CoreOverridesSectionStorage implemen
       return [];
     }
     $translation_settings = $this->getEntity()->get(OverridesSectionStorage::TRANSLATED_CONFIGURATION_FIELD_NAME)->getValue()[0];
-    return $translation_settings['value']['components'][$uuid] ?? [];
+    return isset($translation_settings['value']['components'][$uuid]) ? $translation_settings['value']['components'][$uuid] : [];
   }
 
   /**
diff --git a/src/ResourceTypeRepository.php b/src/ResourceTypeRepository.php
index da63508..8df871a 100644
--- a/src/ResourceTypeRepository.php
+++ b/src/ResourceTypeRepository.php
@@ -6,9 +6,6 @@ use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\jsonapi\ResourceType\ResourceTypeRepository as CoreResourceTypeRepository;
 use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay;
 
-/**
- * Prevents raw layout section data from being exposed via the HTTP API.
- */
 class ResourceTypeRepository extends CoreResourceTypeRepository {
 
   /**
diff --git a/src/TranslationsHelperTrait.php b/src/TranslationsHelperTrait.php
index 5c9c385..0856c13 100644
--- a/src/TranslationsHelperTrait.php
+++ b/src/TranslationsHelperTrait.php
@@ -1,11 +1,13 @@
 <?php
 
+
 namespace Drupal\layout_builder_st;
 
 use Drupal\layout_builder\SectionStorageInterface;
 
+
 /**
- * Trait for methods that will be added to core's LayoutEntityHelperTrait.
+ * Trait for methods that will be added to \Drupal\layout_builder\LayoutEntityHelperTrait
  */
 trait TranslationsHelperTrait {
 
@@ -22,4 +24,5 @@ trait TranslationsHelperTrait {
     return $section_storage instanceof TranslatableSectionStorageInterface && !$section_storage->isDefaultTranslation();
   }
 
+
 }
diff --git a/tests/src/Functional/LayoutBuilderTranslationTest.php b/tests/src/Functional/LayoutBuilderTranslationTest.php
index 4c8a691..5354012 100644
--- a/tests/src/Functional/LayoutBuilderTranslationTest.php
+++ b/tests/src/Functional/LayoutBuilderTranslationTest.php
@@ -8,6 +8,7 @@ use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage;
 use Drupal\Tests\content_translation\Functional\ContentTranslationTestBase;
 use Drupal\Core\Entity\Entity\EntityViewDisplay;
 use Drupal\Core\Url;
+use Drupal\Core\Session\UserSession;
 
 /**
  * Tests that the Layout Builder UI works with translated content.
@@ -18,6 +19,13 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
 
   use TranslationTestTrait;
 
+  /**
+   * The "#1" admin user.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $rootUser;
+
   /**
    * {@inheritdoc}
    */
@@ -27,12 +35,17 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
    * {@inheritdoc}
    */
   protected static $modules = [
+    'layout_builder',
+    'block',
+    'node',
     'content_translation',
     'contextual',
     'entity_test',
     'field_ui',
     'layout_builder_st',
     'block',
+    'locale',
+    'path',
   ];
 
   /**
@@ -41,6 +54,12 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
   protected function setUp(): void {
     parent::setUp();
     $this->doSetup();
+    // Explicitly install required modules.
+    $this->container->get('module_installer')->install(self::$modules);
+    if (!\Drupal::languageManager()->getLanguage('it')) {
+      \Drupal\language\Entity\ConfigurableLanguage::createFromLangcode('it')->save();
+    }
+    
     $this->setUpViewDisplay();
     $this->setUpEntities();
   }
@@ -53,7 +72,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $page = $this->getSession()->getPage();
 
     $entity_url = $this->entity->toUrl('canonical')->toString();
-    $language = \Drupal::languageManager()->getLanguage($this->langcodes[2]);
+    $language = \Drupal::languageManager()->getLanguage('it');
     $translated_entity_url = $this->entity->toUrl('canonical', ['language' => $language])->toString();
     $layout_url = $entity_url . '/layout';
     $translated_layout_url = $translated_entity_url . '/layout';
@@ -80,11 +99,14 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session->pageTextNotContains('The translated field value');
     $assert_session->pageTextContains('The untranslated field value');
 
+    $add_block_text = 'Add block';
+
     // Adjust the layout of the original entity.
-    $page->clickLink('Add block');
+    $assert_session->linkExists($add_block_text);
+    $this->clickLink($add_block_text);
     $assert_session->linkExists('Powered by Drupal');
-    $page->clickLink('Powered by Drupal');
-    $page->pressButton('Add block');
+    $this->clickLink('Powered by Drupal');
+    $page->pressButton($add_block_text);
 
     $assert_session->pageTextContains('Powered by Drupal');
 
@@ -128,7 +150,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session = $this->assertSession();
 
     $entity_url = $this->entity->toUrl('canonical')->toString();
-    $language = \Drupal::languageManager()->getLanguage($this->langcodes[2]);
+    $language = \Drupal::languageManager()->getLanguage('it');
     $translated_entity_url = $this->entity->toUrl('canonical', ['language' => $language])->toString();
     $translated_layout_url = $translated_entity_url . '/layout';
 
@@ -162,9 +184,10 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $field_config->setTranslatable(TRUE);
     $this->assertNotEmpty($field_config->save());
 
+
     $entity_url = $this->entity->toUrl('canonical')->toString();
     $layout_url = $entity_url . '/layout';
-    $language = \Drupal::languageManager()->getLanguage($this->langcodes[2]);
+    $language = \Drupal::languageManager()->getLanguage('it');
     $translated_entity_url = $this->entity->toUrl('canonical', ['language' => $language])->toString();
     $translated_layout_url = $translated_entity_url . '/layout';
 
@@ -187,9 +210,15 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session->pageTextContains('The untranslated field value');
 
     $add_block_text = 'Add block';
+    if (version_compare(\Drupal::VERSION, '8.8.0', '<')) {
+      $add_block_text = ucwords($add_block_text);
+    }
+
     // Adjust the layout of the original entity.
-    $page->clickLink($add_block_text);
-    $page->clickLink('Powered by Drupal');
+    $assert_session->linkExists($add_block_text);
+    $this->clickLink($add_block_text);
+    $assert_session->linkExists('Powered by Drupal');
+    $this->clickLink('Powered by Drupal');
     $page->pressButton($add_block_text);
 
     $assert_session->pageTextContains('Powered by Drupal');
@@ -206,6 +235,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $this->drupalGet($entity_url);
     $assert_session->pageTextContains('Powered by Drupal');
 
+
     // Confirm the translation layout is still not allowed.
     $this->drupalGet($translated_layout_url);
 
@@ -222,7 +252,6 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session->pageTextNotContains('Access denied');
     $assert_session->buttonExists('Save layout');
   }
-
   /**
    * The entity used for testing.
    *
@@ -254,7 +283,17 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
    * Setup translated entity with layouts.
    */
   protected function setUpEntities() {
-    $this->drupalLogin($this->administrator);
+    $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
+    $second_langcode = 'it';
+
+    if (!$this->administrator) {
+      $this->administrator = $this->drupalCreateUser([
+        'administer entity_test_mul display'
+      ]);
+    }
+
+    $this->drupalLogin($this->administrator); 
+    // Create and log in as administrative user.
 
     $field_ui_prefix = 'entity_test_mul/structure/entity_test_mul';
     // Allow overrides for the layout.
@@ -270,25 +309,56 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $entity_type_manager = $this->container->get('entity_type.manager');
     $values = [
       $this->fieldName => [['value' => 'The untranslated field value']],
+      'langcode' => $default_langcode,
     ];
     $label_key = $entity_type_manager->getDefinition($this->entityTypeId)
       ->getKey('label');
     if ($label_key) {
       $values[$label_key] = [['value' => $this->randomMachineName()]];
     }
-    $id = $this->createEntity($values, $this->langcodes[0]);
+    $id = $this->createEntity($values, $default_langcode);
     $storage = $entity_type_manager->getStorage($this->entityTypeId);
     $storage->resetCache([$id]);
     $this->entity = $storage->load($id);
 
+    // "translate editable entities" is a new permission added in Drupal 9.1.0.
+    // See change notice: https://www.drupal.org/node/2975283.
+
     // Create a translation.
-    $this->drupalLogin($this->translator);
+    if (!$this->translator) {
+      $this->translator = $this->drupalCreateUser([
+        'view test entity translations',
+        'translate editable entities',
+        'access contextual links',
+        'configure any layout',
+        'create content translations',
+        'administer nodes',
+        'administer node fields',           // Ensures field administration access.
+        'administer node display',
+        'administer languages',
+        'administer content types',
+        'access administration pages',
+        'administer site configuration',
+        'administer modules',
+        'administer content translation',
+        'administer url aliases',
+        'create url aliases',
+        'translate any entity',  
+      ]);
+
+      $this->translator->addRole('administrator');
+      $this->translator->save();
+    } 
+    
     $add_translation_url = Url::fromRoute("entity.$this->entityTypeId.content_translation_add", [
       $this->entityTypeId => $this->entity->id(),
-      'source' => $this->langcodes[0],
-      'target' => $this->langcodes[2],
+      'source' => $default_langcode,
+      'target' => $second_langcode,
     ]);
+
     $this->drupalGet($add_translation_url);
+    $response_status = $this->getSession()->getStatusCode();
+    $this->assertEquals(200, $response_status, 'Expected a 200 OK status, if not 200 then either something is not installed/configured or there\'s incorrect permissions assigned to this user.');
     $this->submitForm([
       "{$this->fieldName}[0][value]" => 'The translated field value',
     ], 'Save');
@@ -298,12 +368,30 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
    * Set up the View Display.
    */
   protected function setUpViewDisplay() {
+    $bundle = $this->bundle;
+    if (!$bundle) {
+      $bundle = 'entity_test_mul';
+    }
+    $targetEntityType = $this->entityTypeId;
+    if (!$targetEntityType) {
+      $targetEntityType = 'node';
+    }
+
+    // Create the bundle if it doesn't exist.
+    if (!\Drupal::entityTypeManager()->getStorage($targetEntityType)->load($bundle)) {
+      \Drupal::entityTypeManager()->getStorage($targetEntityType)->create([
+        'id' => $bundle,
+        'label' => ucfirst($bundle),
+      ])->save();
+    }
+
     EntityViewDisplay::create([
-      'targetEntityType' => $this->entityTypeId,
-      'bundle' => $this->bundle,
+      'targetEntityType' => $targetEntityType,
+      'bundle' => $bundle,
       'mode' => 'default',
       'status' => TRUE,
-    ])->setComponent($this->fieldName, ['type' => 'string'])->save();
+    ])->setComponent($this->fieldName, ['type' => 'string'])
+      ->save();
   }
 
 }
diff --git a/tests/src/Functional/Rest/OverrideSectionsTest.php b/tests/src/Functional/Rest/OverrideSectionsTest.php
index 93582f4..1ef13c0 100644
--- a/tests/src/Functional/Rest/OverrideSectionsTest.php
+++ b/tests/src/Functional/Rest/OverrideSectionsTest.php
@@ -55,19 +55,11 @@ class OverrideSectionsTest extends LayoutRestTestBase {
       Url::fromRoute('rest.entity.node.GET', ['node' => $this->node->id()])
     );
     $expected_cache_tags = [
-      'config:filter.format.plain_text',
-      'config:rest.resource.entity.node',
-      'http_response',
-      'node:1',
+        'config:filter.format.plain_text',
+        'config:rest.resource.entity.node',
+        'http_response',
+        'node:1',
     ];
-    // Drupal 8 has the rest.settings config object, and its cache tags are
-    // expected to be present in the response. In Drupal 9, the config does not
-    // exist.
-    // @todo Remove this when Drupal 9 is the minimum supported version of core.
-    $rest_settings = $this->config('rest.settings');
-    if (!$rest_settings->isNew()) {
-      $expected_cache_tags = Cache::mergeTags($expected_cache_tags, $rest_settings->getCacheTags());
-    }
     $this->assertResourceResponse(
       200,
       FALSE,
diff --git a/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php b/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
index eda8056..49a2458 100644
--- a/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
+++ b/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
@@ -29,7 +29,7 @@ class InlineBlockTranslationTest extends InlineBlockTestBase {
   protected static $modules = [
     'content_translation',
     'field_ui',
-    'layout_builder_st',
+    'layout_builder_st'
   ];
 
   /**
@@ -53,12 +53,12 @@ class InlineBlockTranslationTest extends InlineBlockTestBase {
 
     $this->drupalLogin($this->drupalCreateUser([
       'access contextual links',
+      'administer blocks',
       'configure any layout',
       'administer node display',
       'administer node fields',
       'translate bundle_with_section_field node',
       'create content translations',
-      'create and edit custom blocks',
     ]));
 
     // Allow layout overrides.
diff --git a/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php b/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php
index 2b5a8c8..b5d3af7 100644
--- a/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php
+++ b/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php
@@ -35,10 +35,10 @@ trait JavascriptTranslationTestTrait {
 
     $translation_selector_prefix = $this->usingConfigTranslation ? '#drupal-off-canvas .translation-set ' : '#drupal-off-canvas ';
     $this->clickContextualLink($block_selector, 'Translate block');
-    $label_input = $assert_session->waitForElementVisible('css', $translation_selector_prefix . '[name="translation[label]"]');
+    $label_input = $assert_session->waitForElementVisible('css', $translation_selector_prefix. '[name="translation[label]"]');
     $this->assertNotEmpty($label_input);
     $this->assertEquals($expected_label, $label_input->getValue());
-    $assert_session->elementTextContains('css', $translation_selector_prefix . '.form-item-source-label', $untranslated_label);
+    $assert_session->elementTextContains('css', $translation_selector_prefix. '.form-item-source-label', $untranslated_label);
     $label_input->setValue($new_label);
     foreach ($unexpected_element_selectors as $unexpected_element_selector) {
       $assert_session->elementNotExists('css', $unexpected_element_selector);
diff --git a/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php b/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php
index 2df4a45..ba0a3e9 100644
--- a/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php
+++ b/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php
@@ -62,7 +62,7 @@ trait LayoutBuilderTestTrait {
    * @param string $message
    *   (optional) Custom message to display with the assertion.
    *
-   * @todo Remove after https://www.drupal.org/project/drupal/issues/2892440
+   * @todo: Remove after https://www.drupal.org/project/drupal/issues/2892440
    */
   public function assertNoElementAfterWait($selector, $timeout = 10000, $message = '') {
     $page = $this->getSession()->getPage();
diff --git a/tests/src/FunctionalJavascript/TranslationTest.php b/tests/src/FunctionalJavascript/TranslationTest.php
index 9e6044b..da96cdf 100644
--- a/tests/src/FunctionalJavascript/TranslationTest.php
+++ b/tests/src/FunctionalJavascript/TranslationTest.php
@@ -67,6 +67,7 @@ class TranslationTest extends WebDriverTestBase {
       $this->container->get('module_installer')->install(['layout_builder_st']);
     }
 
+
     $page = $this->getSession()->getPage();
     $assert_session = $this->assertSession();
 
@@ -114,7 +115,7 @@ class TranslationTest extends WebDriverTestBase {
     // Update the translations block label.
     $this->drupalGet('it/node/1/layout');
     $this->assertNonTranslationActionsRemoved();
-    $this->updateBlockTranslation('.block-system-powered-by-block', 'untranslated label', 'label updated in translation', 'label in translation');
+    $this->updateBlockTranslation('.block-system-powered-by-block', 'untranslated label', 'label updated in translation','label in translation');
 
     $assert_session->buttonExists('Save layout');
     $page->pressButton('Save layout');
@@ -137,7 +138,7 @@ class TranslationTest extends WebDriverTestBase {
 
     $this->createContentType([
       'type' => 'bundle_with_section_field',
-      'new_revision' => TRUE,
+      'new_revision' => TRUE
     ]);
     $this->createNode([
       'type' => 'bundle_with_section_field',
-- 
GitLab


From 23f1ea840a96deb855d09613c26f2dae750d9fd6 Mon Sep 17 00:00:00 2001
From: "joseph.olstad" <joseph.olstad@1321830.no-reply.drupal.org>
Date: Wed, 23 Apr 2025 13:16:52 -0400
Subject: [PATCH 27/27] Revert "Issue #3497945 by liam morland, joseph.olstad,
 phenaproxima, danrod: A functional d11 build of layout_builder_st."

This reverts commit 35f35a16096bf6ddeddbfa4229f3f28386c5cb97.
---
 layout_builder_st.info.yml                    |   2 +-
 layout_builder_st.install                     |  34 ++---
 layout_builder_st.libraries.yml               |   5 -
 layout_builder_st.links.contextual.yml        |   1 -
 layout_builder_st.module                      |  53 ++++----
 layout_builder_st.services.yml                |  14 +-
 src/DependencyInjection/ClassResolver.php     |  18 ++-
 src/Element/LayoutBuilder.php                 |  77 ++---------
 src/ElementManager.php                        |  27 ----
 .../ComponentPluginTranslate.php              |   9 +-
 src/Field/LayoutTranslationItemList.php       |   5 +-
 .../BlockContentInlineBlockTranslateForm.php  |   2 +-
 src/Form/OverridesEntityForm.php              |   7 +-
 src/Form/TranslateBlockForm.php               |   8 +-
 src/InlineBlockEntityOperations.php           |   5 +-
 src/LayoutBuilderStServiceProvider.php        |   3 +
 src/Plugin/Block/InlineBlock.php              |   1 -
 .../OverridesSectionStorage.php               |  20 +--
 src/ResourceTypeRepository.php                |   3 +
 src/TranslationsHelperTrait.php               |   5 +-
 .../LayoutBuilderTranslationTest.php          | 122 +++---------------
 .../Functional/Rest/OverrideSectionsTest.php  |  16 ++-
 .../InlineBlockTranslationTest.php            |   4 +-
 .../JavascriptTranslationTestTrait.php        |   4 +-
 .../LayoutBuilderTestTrait.php                |   2 +-
 .../FunctionalJavascript/TranslationTest.php  |   5 +-
 26 files changed, 139 insertions(+), 313 deletions(-)
 delete mode 100644 layout_builder_st.libraries.yml
 delete mode 100644 src/ElementManager.php

diff --git a/layout_builder_st.info.yml b/layout_builder_st.info.yml
index 7643a14..8e1f02d 100644
--- a/layout_builder_st.info.yml
+++ b/layout_builder_st.info.yml
@@ -2,6 +2,6 @@ name: 'Layout Builder Symmetric Translations'
 type: module
 description: 'Allows translating Layout overrides'
 package: Layout Builder
-core_version_requirement: ^9.5 || ^10.2 || ^11
+core_version_requirement: ^10 || ^11
 dependencies:
   - drupal:layout_builder
diff --git a/layout_builder_st.install b/layout_builder_st.install
index 10bc99a..bb99fcc 100644
--- a/layout_builder_st.install
+++ b/layout_builder_st.install
@@ -1,10 +1,14 @@
 <?php
 
+/**
+ * @file
+ * Contains installation and update hooks for layout_builder_st.
+ */
+
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
 
-
 /**
  * Implements hook_install().
  */
@@ -14,21 +18,15 @@ function layout_builder_st_install() {
   $field_manager = \Drupal::service('entity_field.manager');
   $field_map = $field_manager->getFieldMap();
   foreach ($field_map as $entity_type_id => $field_infos) {
-    if (isset($field_infos[\Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::FIELD_NAME]['bundles'])) {
-      $non_translatable_bundle_count = 0;
-      foreach ($field_infos[OverridesSectionStorage::FIELD_NAME]['bundles'] as $bundle) {
-        $bundles_not_added = [];
-        // The field map can contain stale information. If the field does not
-        // exist, ignore it. The field map will be rebuilt when the cache is
-        // cleared at the end of the update process.
-        if (!$field_config = FieldConfig::loadByName($entity_type_id, $bundle, OverridesSectionStorage::FIELD_NAME)) {
-          continue;
-        }
-        _layout_builder_st_add_translation_field($entity_type_id, $bundle);
-
+    foreach ($field_infos[OverridesSectionStorage::FIELD_NAME]['bundles'] ?? [] as $bundle) {
+      // The field map can contain stale information. If the field does not
+      // exist, ignore it. The field map will be rebuilt when the cache is
+      // cleared at the end of the update process.
+      if (!FieldConfig::loadByName($entity_type_id, $bundle, OverridesSectionStorage::FIELD_NAME)) {
+        continue;
       }
+      _layout_builder_st_add_translation_field($entity_type_id, $bundle);
     }
-
   }
 }
 
@@ -65,7 +63,6 @@ function _layout_builder_st_add_translation_field($entity_type_id, $bundle) {
   }
 }
 
-
 /**
  * Implements hook_requirements().
  */
@@ -87,10 +84,3 @@ function layout_builder_st_requirements($phase) {
 
   return $requirements;
 }
-
-/**
- * Rebuilding container, because of D11 related services.yml changes.
- */
-function layout_builder_st_update_10001() {
-  \Drupal::service('kernel')->rebuildContainer();
-}
diff --git a/layout_builder_st.libraries.yml b/layout_builder_st.libraries.yml
deleted file mode 100644
index 9877da7..0000000
--- a/layout_builder_st.libraries.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-contextual:
-  js:
-    js/contextual.js: {}
-  dependencies:
-    - core/jquery
diff --git a/layout_builder_st.links.contextual.yml b/layout_builder_st.links.contextual.yml
index a23b0c4..e2a31ff 100644
--- a/layout_builder_st.links.contextual.yml
+++ b/layout_builder_st.links.contextual.yml
@@ -17,4 +17,3 @@ layout_builder_inline_block_translate:
       class: ['use-ajax']
       data-dialog-type: dialog
       data-dialog-renderer: off_canvas
-
diff --git a/layout_builder_st.module b/layout_builder_st.module
index 5fbfe61..7de63c5 100644
--- a/layout_builder_st.module
+++ b/layout_builder_st.module
@@ -1,40 +1,39 @@
 <?php
 
-use Drupal\Component\Plugin\ConfigurableInterface;
+/**
+ * @file
+ * Contains hook implementations for layout_builder_st.
+ */
+
 use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\layout_builder_st\Element\LayoutBuilder;
 use Drupal\layout_builder_st\Entity\LayoutBuilderEntityViewDisplay;
 use Drupal\layout_builder_st\Form\BlockContentInlineBlockTranslateForm;
 use Drupal\layout_builder\Form\OverridesEntityForm as CoreOverridesEntityForm;
-use Drupal\layout_builder_st\Form\BlockPluginTranslationForm;
 use Drupal\layout_builder_st\Form\OverridesEntityForm;
 use Drupal\layout_builder_st\Plugin\Block\InlineBlock;
 use Drupal\layout_builder_st\Plugin\Field\FieldWidget\LayoutBuilderWidget;
 use Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSectionStorage;
 
-
 /**
  * Implements hook_module_implements_alter().
  */
-function layout_builder_st_module_implements_alter(&$implementations, $hook) {
-  switch ($hook) {
+function layout_builder_st_module_implements_alter(array &$implementations, string $hook): void {
+  if ($hook === 'entity_type_alter') {
     // Move our hook_entity_type_alter() implementation to the end of the list.
-    // it must run after layout_builder_st_entity_type_alter().
-    case 'entity_type_alter':
-      $group = $implementations['layout_builder_st'];
-      unset($implementations['layout_builder_st']);
-      $implementations['layout_builder_st'] = $group;
-      break;
+    // it must run after layout_builder_entity_type_alter().
+    $group = $implementations['layout_builder_st'];
+    unset($implementations['layout_builder_st']);
+    $implementations['layout_builder_st'] = $group;
   }
 }
 
-
 /**
  * Implements hook_entity_type_alter().
  *
- * Copied from https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
+ * @see https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
  */
-function layout_builder_st_entity_type_alter(array &$entity_types) {
-
+function layout_builder_st_entity_type_alter(array &$entity_types): void {
   // Replace entity_view_display class with our own.
   /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['entity_view_display']
@@ -65,9 +64,9 @@ function layout_builder_st_entity_type_alter(array &$entity_types) {
 /**
  * Implements hook_block_alter().
  */
-function layout_builder_st_block_alter(&$definitions) {
+function layout_builder_st_block_alter(array &$definitions): void {
   foreach ($definitions as &$definition) {
-    if ($definition['id']  === 'inline_block') {
+    if ($definition['id'] === 'inline_block') {
       // Replace with our extended InlineBlock class to handle translations.
       $definition['class'] = InlineBlock::class;
     }
@@ -76,10 +75,8 @@ function layout_builder_st_block_alter(&$definitions) {
 
 /**
  * Implements hook_layout_builder_section_storage_alter().
- *
- * @param \Drupal\layout_builder\SectionStorage\SectionStorageDefinition[] $definitions
  */
-function layout_builder_st_layout_builder_section_storage_alter(array &$definitions) {
+function layout_builder_st_layout_builder_section_storage_alter(array &$definitions): void {
   $definition = $definitions['overrides'];
   $definition->setClass(OverridesSectionStorage::class);
 }
@@ -87,7 +84,7 @@ function layout_builder_st_layout_builder_section_storage_alter(array &$definiti
 /**
  * Implements hook_field_widget_info_alter().
  */
-function layout_builder_st_field_widget_info_alter(array &$info) {
+function layout_builder_st_field_widget_info_alter(array &$info): void {
   if (isset($info['layout_builder_widget'])) {
     $info['layout_builder_widget']['field_types'][] = 'layout_translation';
     $info['layout_builder_widget']['class'] = LayoutBuilderWidget::class;
@@ -98,8 +95,18 @@ function layout_builder_st_field_widget_info_alter(array &$info) {
 /**
  * Implements hook_modules_installed().
  */
-function layout_builder_st_modules_installed($modules) {
-  if (in_array('layout_builder_at', $modules)) {
+function layout_builder_st_modules_installed(array $modules): void {
+  if (in_array('layout_builder_at', $modules, TRUE)) {
     \Drupal::messenger()->addError('Layout Builder Symmetric Translations is not compatible with Layout Builder Asymmetric Translations. One of these should be uninstalled');
   }
 }
+
+/**
+ * Implements hook_element_plugin_alter().
+ */
+function layout_builder_st_element_plugin_alter(array &$definitions): void {
+  if (isset($definitions['layout_builder'])) {
+    $definitions['layout_builder']['class'] = LayoutBuilder::class;
+    $definitions['layout_builder']['provider'] = 'layout_builder_st';
+  }
+}
diff --git a/layout_builder_st.services.yml b/layout_builder_st.services.yml
index ae9288e..0c6b90a 100644
--- a/layout_builder_st.services.yml
+++ b/layout_builder_st.services.yml
@@ -14,13 +14,7 @@ services:
     class: Drupal\layout_builder_st\Routing\RouteSubscriber
     tags:
       - { name: event_subscriber }
-
-  # Override the class resolver to so that InlineBlockEntityOperations can be swapped to the extend version.
-  class_resolver:
-    class: Drupal\layout_builder_st\DependencyInjection\ClassResolver
-    arguments: ['@service_container']
-  Drupal\Core\DependencyInjection\ClassResolverInterface: '@class_resolver'
-  plugin.manager.element_info:
-    class: Drupal\layout_builder_st\ElementManager
-    arguments: ['@container.namespaces', '@cache.discovery', '@theme_handler', '@module_handler', '@theme.manager']
-  Drupal\Core\Render\ElementInfoManagerInterface: '@plugin.manager.element_info'
+  Drupal\layout_builder_st\DependencyInjection\ClassResolver:
+    public: false
+    decorates: class_resolver
+    arguments: ['@.inner']
diff --git a/src/DependencyInjection/ClassResolver.php b/src/DependencyInjection/ClassResolver.php
index 675e8b9..7c69bbd 100644
--- a/src/DependencyInjection/ClassResolver.php
+++ b/src/DependencyInjection/ClassResolver.php
@@ -2,21 +2,27 @@
 
 namespace Drupal\layout_builder_st\DependencyInjection;
 
-use Drupal\Core\DependencyInjection\ClassResolver as CoreClassResolver;
+use Drupal\Core\DependencyInjection\ClassResolverInterface;
 use Drupal\layout_builder\InlineBlockEntityOperations as CoreInlineBlockEntityOperations;
 use Drupal\layout_builder_st\InlineBlockEntityOperations;
 
 /**
- * ClassResolver to load the extended InlineBlockEntityOperations class.
+ * Decorates the class resolver to load our InlineBlockEntityOperations class.
  */
-final class ClassResolver extends CoreClassResolver {
+final class ClassResolver implements ClassResolverInterface {
 
-  public function getInstanceFromDefinition($definition) {
+  public function __construct(
+    private readonly ClassResolverInterface $decorated,
+  ) {}
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getInstanceFromDefinition($definition): object {
     if ($definition === CoreInlineBlockEntityOperations::class) {
       $definition = InlineBlockEntityOperations::class;
     }
-    return parent::getInstanceFromDefinition($definition);
+    return $this->decorated->getInstanceFromDefinition($definition);
   }
 
-
 }
diff --git a/src/Element/LayoutBuilder.php b/src/Element/LayoutBuilder.php
index eb8f2d5..a7ee182 100644
--- a/src/Element/LayoutBuilder.php
+++ b/src/Element/LayoutBuilder.php
@@ -2,12 +2,11 @@
 
 namespace Drupal\layout_builder_st\Element;
 
-use Drupal\Component\Plugin\ConfigurableInterface;
 use Drupal\Component\Plugin\DerivativeInspectionInterface;
+use Drupal\Core\DependencyInjection\DependencySerializationTrait;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Render\Element;
 use Drupal\layout_builder\Element\LayoutBuilder as CoreLayoutBuilder;
-use Drupal\layout_builder\SectionComponent;
 use Drupal\layout_builder\SectionStorageInterface;
 use Drupal\layout_builder_st\TranslationsHelperTrait;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -17,57 +16,29 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  */
 final class LayoutBuilder extends CoreLayoutBuilder {
 
+  use DependencySerializationTrait;
   use TranslationsHelperTrait;
 
-  /**
-   * The entity type manager.
-   *
-   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
-   */
-  protected $entityTypeManager;
-
-  /**
-   * Constructs a new LayoutBuilder.
-   *
-   * @param array $configuration
-   *   A configuration array containing information about the plugin instance.
-   * @param string $plugin_id
-   *   The plugin ID for the plugin instance.
-   * @param mixed $plugin_definition
-   *   The plugin implementation definition.
-   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
-   *   The event dispatcher service.
-   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
-   *   The entity type manager.
-   */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, $event_dispatcher, EntityTypeManagerInterface $entity_type_manager) {
-    parent::__construct($configuration, $plugin_id, $plugin_definition, $event_dispatcher);
-    $this->entityTypeManager = $entity_type_manager;
+  public function __construct(
+    private readonly EntityTypeManagerInterface $entityTypeManager,
+    mixed ...$arguments,
+  ) {
+    parent::__construct(...$arguments);
   }
 
   /**
    * {@inheritdoc}
    */
-  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): self {
     return new static(
+      $container->get(EntityTypeManagerInterface::class),
       $configuration,
       $plugin_id,
       $plugin_definition,
       $container->get('event_dispatcher'),
-      $container->get('entity_type.manager')
     );
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  protected function layout(SectionStorageInterface $section_storage) {
-    $output = parent::layout($section_storage);
-    $output['#attached']['library'][] = 'layout_builder_st/contextual';
-
-    return $output;
-  }
-
   /**
    * {@inheritdoc}
    */
@@ -122,14 +93,12 @@ final class LayoutBuilder extends CoreLayoutBuilder {
    *
    * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
    *   The section storage.
-   * @param $delta
+   * @param string $delta
    *   The section delta.
-   * @param $region
+   * @param string $region
    *   The region.
-   * @param $uuid
+   * @param string $uuid
    *   The UUID of the component.
-   * @param $is_translation
-   *   Whether the section storage is handling a translation.
    *
    * @return array|null
    *   The contextual link render array or NULL if none.
@@ -179,26 +148,4 @@ final class LayoutBuilder extends CoreLayoutBuilder {
     ];
   }
 
-  /**
-   * Determines whether the component has translatable configuration.
-   *
-   * This function is replacement for \Drupal\layout_builder\SectionComponent::hasTranslatableConfiguration()
-   * in https://www.drupal.org/project/drupal/issues/2946333#comment-13129737
-   * This avoids having to alter the class in the module.
-   *
-   * @param \Drupal\layout_builder\SectionComponent $component
-   *
-   * @return bool
-   *   TRUE if the plugin has translatable configuration.
-   */
-  private static function hasTranslatableConfiguration(SectionComponent $component) {
-    $plugin = $component->getPlugin();
-    if ($plugin instanceof ConfigurableInterface) {
-      // For all plugins of ConfigurableInterface, only allow label translation.
-      $configuration = $plugin->getConfiguration();
-      return !empty($configuration['label_display']) && !empty($configuration['label']);
-    }
-    return FALSE;
-  }
-
 }
diff --git a/src/ElementManager.php b/src/ElementManager.php
deleted file mode 100644
index 88f5302..0000000
--- a/src/ElementManager.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-namespace Drupal\layout_builder_st;
-
-use Drupal\Core\Render\ElementInfoManager;
-use Drupal\layout_builder_st\Element\LayoutBuilder;
-
-/**
- * ElementManager extended to alter LayoutBuilder Element.
- *
- * @todo Remove if https://www.drupal.org/node/2987208 is fixed.
- */
-final class ElementManager extends ElementInfoManager {
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function alterDefinitions(&$definitions) {
-    parent::alterDefinitions($definitions);
-    // Replace LayoutBuilder element class.
-    if (isset($definitions['layout_builder'])) {
-      $definitions['layout_builder']['class'] = LayoutBuilder::class;
-      $definitions['layout_builder']['provider'] = 'layout_builder_st';
-    }
-  }
-
-}
diff --git a/src/EventSubscriber/ComponentPluginTranslate.php b/src/EventSubscriber/ComponentPluginTranslate.php
index 1253940..e68d598 100644
--- a/src/EventSubscriber/ComponentPluginTranslate.php
+++ b/src/EventSubscriber/ComponentPluginTranslate.php
@@ -20,7 +20,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 final class ComponentPluginTranslate implements EventSubscriberInterface {
 
   use LayoutEntityHelperTrait;
-  //  This trait will be merged into core's.
+  // This trait will be merged into core's.
   use TranslationsHelperTrait;
 
   /**
@@ -51,10 +51,7 @@ final class ComponentPluginTranslate implements EventSubscriberInterface {
   }
 
   /**
-   * Returns a list of subscribed events.
-   * 
-   * @return array
-   *  This returns an array of the subscribed events.
+   * {@inheritdoc}
    */
   public static function getSubscribedEvents() {
     $events[LayoutBuilderEvents::SECTION_COMPONENT_BUILD_RENDER_ARRAY] = ['onBuildRender', 200];
@@ -90,7 +87,7 @@ final class ComponentPluginTranslate implements EventSubscriberInterface {
 
     if (static::isTranslation($section_storage)) {
       if ($translated_plugin_configuration = $section_storage->getTranslatedComponentConfiguration($component->getUuid())) {
-        $translated_plugin_configuration = array_replace_recursive($configuration, $translated_plugin_configuration);
+        $translated_plugin_configuration += $configuration;
         $plugin->setConfiguration($translated_plugin_configuration);
       }
     }
diff --git a/src/Field/LayoutTranslationItemList.php b/src/Field/LayoutTranslationItemList.php
index a6e8952..93b05d0 100644
--- a/src/Field/LayoutTranslationItemList.php
+++ b/src/Field/LayoutTranslationItemList.php
@@ -6,6 +6,9 @@ use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Field\FieldItemList;
 use Drupal\Core\Session\AccountInterface;
 
+/**
+ * A list of layout translation items.
+ */
 final class LayoutTranslationItemList extends FieldItemList {
 
   /**
@@ -13,7 +16,7 @@ final class LayoutTranslationItemList extends FieldItemList {
    *
    * @ingroup layout_builder_access
    */
-  public function defaultAccess($operation = 'view', AccountInterface $account = NULL) {
+  public function defaultAccess($operation = 'view', ?AccountInterface $account = NULL) {
     // @todo Allow access in https://www.drupal.org/node/2942975.
     return AccessResult::forbidden();
   }
diff --git a/src/Form/BlockContentInlineBlockTranslateForm.php b/src/Form/BlockContentInlineBlockTranslateForm.php
index 5af2b7d..b6bb0b1 100644
--- a/src/Form/BlockContentInlineBlockTranslateForm.php
+++ b/src/Form/BlockContentInlineBlockTranslateForm.php
@@ -50,7 +50,7 @@ final class BlockContentInlineBlockTranslateForm extends BlockContentForm {
   /**
    * {@inheritdoc}
    */
-  public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL, RouteMatchInterface $route_match = NULL, LayoutTempstoreRepositoryInterface $tempstore = NULL) {
+  public function __construct(EntityRepositoryInterface $entity_repository, ?EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, ?TimeInterface $time = NULL, ?RouteMatchInterface $route_match = NULL, ?LayoutTempstoreRepositoryInterface $tempstore = NULL) {
     parent::__construct($entity_repository, $entity_type_bundle_info, $time);
     $this->routeMatch = $route_match;
     $this->layoutTempstoreRepository = $tempstore;
diff --git a/src/Form/OverridesEntityForm.php b/src/Form/OverridesEntityForm.php
index 8ff3595..485e446 100644
--- a/src/Form/OverridesEntityForm.php
+++ b/src/Form/OverridesEntityForm.php
@@ -9,7 +9,7 @@ use Drupal\layout_builder\SectionStorageInterface;
 use Drupal\layout_builder_st\TranslationsHelperTrait;
 
 /**
- * Extended OverridesEntityForm
+ * This class extends core class OverridesEntityForm.
  */
 final class OverridesEntityForm extends CoreOverridesEntityForm {
 
@@ -18,11 +18,10 @@ final class OverridesEntityForm extends CoreOverridesEntityForm {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, ?SectionStorageInterface $section_storage = NULL) {
     $form = parent::buildForm($form, $form_state, $section_storage);
     $form[OverridesSectionStorage::TRANSLATED_CONFIGURATION_FIELD_NAME]['#access'] = TRUE;
     return $form;
-
   }
 
   /**
@@ -51,7 +50,7 @@ final class OverridesEntityForm extends CoreOverridesEntityForm {
    */
   protected function actions(array $form, FormStateInterface $form_state) {
     $actions = parent::actions($form, $form_state);
-    if(static::isTranslation($this->sectionStorage)) {
+    if (static::isTranslation($this->sectionStorage)) {
       unset($actions['revert']);
     }
     return $actions;
diff --git a/src/Form/TranslateBlockForm.php b/src/Form/TranslateBlockForm.php
index 88d0086..a5faee8 100644
--- a/src/Form/TranslateBlockForm.php
+++ b/src/Form/TranslateBlockForm.php
@@ -57,6 +57,8 @@ class TranslateBlockForm extends FormBase {
   protected $moduleHandler;
 
   /**
+   * The typed config manager.
+   *
    * @var \Drupal\Core\Config\TypedConfigManagerInterface
    */
   protected $typedConfigManager;
@@ -107,7 +109,7 @@ class TranslateBlockForm extends FormBase {
    * @return array
    *   The form array.
    */
-  public function buildForm(array $form, FormStateInterface $form_state, TranslatableSectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $uuid = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, ?TranslatableSectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $uuid = NULL) {
     $component = $section_storage->getSection($delta)->getComponent($uuid);
 
     $this->sectionStorage = $section_storage;
@@ -179,13 +181,13 @@ class TranslateBlockForm extends FormBase {
         $element_build['label']['source'] = [
           '#type' => 'item',
           '#title' => $this->t('Label'),
-          '#markup' => $label_data->getValue()?: '(' . $this->t('Empty') . ')',
+          '#markup' => $label_data->getValue() ?: '(' . $this->t('Empty') . ')',
           '#parents' => ['source', 'label'],
         ];
         $element_build['label']['translation'] = [
           '#type' => 'textfield',
           '#title' => $this->t('Label'),
-          '#default_value' => isset($translated_configuration['label']) ? $translated_configuration['label'] : '',
+          '#default_value' => $translated_configuration['label'] ?? '',
           '#parents' => ['translation', 'label'],
         ];
       }
diff --git a/src/InlineBlockEntityOperations.php b/src/InlineBlockEntityOperations.php
index b4257e9..3673a60 100644
--- a/src/InlineBlockEntityOperations.php
+++ b/src/InlineBlockEntityOperations.php
@@ -7,7 +7,9 @@ use Drupal\layout_builder\InlineBlockEntityOperations as CoreInlineBlockEntityOp
 use Drupal\layout_builder\SectionComponent;
 
 /**
- * Overrides cores InlineBlockEntityOperations to provide translation operations.
+ * This class overrides core InlineBlockEntityOperations.
+ *
+ * This was implemented to provide translation operations.
  */
 final class InlineBlockEntityOperations extends CoreInlineBlockEntityOperations {
 
@@ -67,5 +69,4 @@ final class InlineBlockEntityOperations extends CoreInlineBlockEntityOperations
 
   }
 
-
 }
diff --git a/src/LayoutBuilderStServiceProvider.php b/src/LayoutBuilderStServiceProvider.php
index d079ce6..3ee2f99 100644
--- a/src/LayoutBuilderStServiceProvider.php
+++ b/src/LayoutBuilderStServiceProvider.php
@@ -5,6 +5,9 @@ namespace Drupal\layout_builder_st;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceProviderBase;
 
+/**
+ * Overrides core services.
+ */
 class LayoutBuilderStServiceProvider extends ServiceProviderBase {
 
   /**
diff --git a/src/Plugin/Block/InlineBlock.php b/src/Plugin/Block/InlineBlock.php
index 6dd5385..3f2d4d1 100644
--- a/src/Plugin/Block/InlineBlock.php
+++ b/src/Plugin/Block/InlineBlock.php
@@ -28,5 +28,4 @@ final class InlineBlock extends CoreInlineBlock {
     return $form;
   }
 
-
 }
diff --git a/src/Plugin/SectionStorage/OverridesSectionStorage.php b/src/Plugin/SectionStorage/OverridesSectionStorage.php
index 02a187b..6e85c03 100644
--- a/src/Plugin/SectionStorage/OverridesSectionStorage.php
+++ b/src/Plugin/SectionStorage/OverridesSectionStorage.php
@@ -8,9 +8,11 @@ use Drupal\Core\Session\AccountInterface;
 use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage as CoreOverridesSectionStorage;
 use Drupal\layout_builder_st\TranslatableSectionStorageInterface;
 
+/**
+ * {@inheritdoc}
+ */
 final class OverridesSectionStorage extends CoreOverridesSectionStorage implements TranslatableSectionStorageInterface {
 
-
   /**
    * The field name for translated configuration used by this storage.
    *
@@ -23,22 +25,12 @@ final class OverridesSectionStorage extends CoreOverridesSectionStorage implemen
    */
   protected function handleTranslationAccess(AccessResult $result, $operation, AccountInterface $account) {
     $entity = $this->getEntity();
-
-    // Check if the entity is not null and allows overrides before accessing its properties.
-    if (!$entity || !$entity->hasField(static::FIELD_NAME)) {
-      // Return a neutral result if the entity is null.
-      return AccessResult::neutral();
-    }
-
     $field_config = $entity->getFieldDefinition(static::FIELD_NAME)->getConfig($entity->bundle());
-
-    // Access is allowed if one of the following conditions is true:
+    // Access is allow if one of the following conditions is true:
     // 1. This is the default translation.
     // 2. The entity is translatable and the layout is overridden and the layout
     //    field is not translatable.
-    return $result->andIf(AccessResult::allowedIf($this->isDefaultTranslation() || ($entity instanceof TranslatableInterface && $this->isOverridden() && !$field_config->isTranslatable())))
-      ->addCacheableDependency($entity)
-      ->addCacheableDependency($field_config);
+    return $result->andIf(AccessResult::allowedIf($this->isDefaultTranslation() || ($entity instanceof TranslatableInterface && $this->isOverridden() && !$field_config->isTranslatable())))->addCacheableDependency($entity)->addCacheableDependency($field_config);
   }
 
   /**
@@ -86,7 +78,7 @@ final class OverridesSectionStorage extends CoreOverridesSectionStorage implemen
       return [];
     }
     $translation_settings = $this->getEntity()->get(OverridesSectionStorage::TRANSLATED_CONFIGURATION_FIELD_NAME)->getValue()[0];
-    return isset($translation_settings['value']['components'][$uuid]) ? $translation_settings['value']['components'][$uuid] : [];
+    return $translation_settings['value']['components'][$uuid] ?? [];
   }
 
   /**
diff --git a/src/ResourceTypeRepository.php b/src/ResourceTypeRepository.php
index 8df871a..da63508 100644
--- a/src/ResourceTypeRepository.php
+++ b/src/ResourceTypeRepository.php
@@ -6,6 +6,9 @@ use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\jsonapi\ResourceType\ResourceTypeRepository as CoreResourceTypeRepository;
 use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay;
 
+/**
+ * Prevents raw layout section data from being exposed via the HTTP API.
+ */
 class ResourceTypeRepository extends CoreResourceTypeRepository {
 
   /**
diff --git a/src/TranslationsHelperTrait.php b/src/TranslationsHelperTrait.php
index 0856c13..5c9c385 100644
--- a/src/TranslationsHelperTrait.php
+++ b/src/TranslationsHelperTrait.php
@@ -1,13 +1,11 @@
 <?php
 
-
 namespace Drupal\layout_builder_st;
 
 use Drupal\layout_builder\SectionStorageInterface;
 
-
 /**
- * Trait for methods that will be added to \Drupal\layout_builder\LayoutEntityHelperTrait
+ * Trait for methods that will be added to core's LayoutEntityHelperTrait.
  */
 trait TranslationsHelperTrait {
 
@@ -24,5 +22,4 @@ trait TranslationsHelperTrait {
     return $section_storage instanceof TranslatableSectionStorageInterface && !$section_storage->isDefaultTranslation();
   }
 
-
 }
diff --git a/tests/src/Functional/LayoutBuilderTranslationTest.php b/tests/src/Functional/LayoutBuilderTranslationTest.php
index 5354012..4c8a691 100644
--- a/tests/src/Functional/LayoutBuilderTranslationTest.php
+++ b/tests/src/Functional/LayoutBuilderTranslationTest.php
@@ -8,7 +8,6 @@ use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage;
 use Drupal\Tests\content_translation\Functional\ContentTranslationTestBase;
 use Drupal\Core\Entity\Entity\EntityViewDisplay;
 use Drupal\Core\Url;
-use Drupal\Core\Session\UserSession;
 
 /**
  * Tests that the Layout Builder UI works with translated content.
@@ -19,13 +18,6 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
 
   use TranslationTestTrait;
 
-  /**
-   * The "#1" admin user.
-   *
-   * @var \Drupal\Core\Session\AccountInterface
-   */
-  protected $rootUser;
-
   /**
    * {@inheritdoc}
    */
@@ -35,17 +27,12 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
    * {@inheritdoc}
    */
   protected static $modules = [
-    'layout_builder',
-    'block',
-    'node',
     'content_translation',
     'contextual',
     'entity_test',
     'field_ui',
     'layout_builder_st',
     'block',
-    'locale',
-    'path',
   ];
 
   /**
@@ -54,12 +41,6 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
   protected function setUp(): void {
     parent::setUp();
     $this->doSetup();
-    // Explicitly install required modules.
-    $this->container->get('module_installer')->install(self::$modules);
-    if (!\Drupal::languageManager()->getLanguage('it')) {
-      \Drupal\language\Entity\ConfigurableLanguage::createFromLangcode('it')->save();
-    }
-    
     $this->setUpViewDisplay();
     $this->setUpEntities();
   }
@@ -72,7 +53,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $page = $this->getSession()->getPage();
 
     $entity_url = $this->entity->toUrl('canonical')->toString();
-    $language = \Drupal::languageManager()->getLanguage('it');
+    $language = \Drupal::languageManager()->getLanguage($this->langcodes[2]);
     $translated_entity_url = $this->entity->toUrl('canonical', ['language' => $language])->toString();
     $layout_url = $entity_url . '/layout';
     $translated_layout_url = $translated_entity_url . '/layout';
@@ -99,14 +80,11 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session->pageTextNotContains('The translated field value');
     $assert_session->pageTextContains('The untranslated field value');
 
-    $add_block_text = 'Add block';
-
     // Adjust the layout of the original entity.
-    $assert_session->linkExists($add_block_text);
-    $this->clickLink($add_block_text);
+    $page->clickLink('Add block');
     $assert_session->linkExists('Powered by Drupal');
-    $this->clickLink('Powered by Drupal');
-    $page->pressButton($add_block_text);
+    $page->clickLink('Powered by Drupal');
+    $page->pressButton('Add block');
 
     $assert_session->pageTextContains('Powered by Drupal');
 
@@ -150,7 +128,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session = $this->assertSession();
 
     $entity_url = $this->entity->toUrl('canonical')->toString();
-    $language = \Drupal::languageManager()->getLanguage('it');
+    $language = \Drupal::languageManager()->getLanguage($this->langcodes[2]);
     $translated_entity_url = $this->entity->toUrl('canonical', ['language' => $language])->toString();
     $translated_layout_url = $translated_entity_url . '/layout';
 
@@ -184,10 +162,9 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $field_config->setTranslatable(TRUE);
     $this->assertNotEmpty($field_config->save());
 
-
     $entity_url = $this->entity->toUrl('canonical')->toString();
     $layout_url = $entity_url . '/layout';
-    $language = \Drupal::languageManager()->getLanguage('it');
+    $language = \Drupal::languageManager()->getLanguage($this->langcodes[2]);
     $translated_entity_url = $this->entity->toUrl('canonical', ['language' => $language])->toString();
     $translated_layout_url = $translated_entity_url . '/layout';
 
@@ -210,15 +187,9 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session->pageTextContains('The untranslated field value');
 
     $add_block_text = 'Add block';
-    if (version_compare(\Drupal::VERSION, '8.8.0', '<')) {
-      $add_block_text = ucwords($add_block_text);
-    }
-
     // Adjust the layout of the original entity.
-    $assert_session->linkExists($add_block_text);
-    $this->clickLink($add_block_text);
-    $assert_session->linkExists('Powered by Drupal');
-    $this->clickLink('Powered by Drupal');
+    $page->clickLink($add_block_text);
+    $page->clickLink('Powered by Drupal');
     $page->pressButton($add_block_text);
 
     $assert_session->pageTextContains('Powered by Drupal');
@@ -235,7 +206,6 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $this->drupalGet($entity_url);
     $assert_session->pageTextContains('Powered by Drupal');
 
-
     // Confirm the translation layout is still not allowed.
     $this->drupalGet($translated_layout_url);
 
@@ -252,6 +222,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $assert_session->pageTextNotContains('Access denied');
     $assert_session->buttonExists('Save layout');
   }
+
   /**
    * The entity used for testing.
    *
@@ -283,17 +254,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
    * Setup translated entity with layouts.
    */
   protected function setUpEntities() {
-    $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
-    $second_langcode = 'it';
-
-    if (!$this->administrator) {
-      $this->administrator = $this->drupalCreateUser([
-        'administer entity_test_mul display'
-      ]);
-    }
-
-    $this->drupalLogin($this->administrator); 
-    // Create and log in as administrative user.
+    $this->drupalLogin($this->administrator);
 
     $field_ui_prefix = 'entity_test_mul/structure/entity_test_mul';
     // Allow overrides for the layout.
@@ -309,56 +270,25 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
     $entity_type_manager = $this->container->get('entity_type.manager');
     $values = [
       $this->fieldName => [['value' => 'The untranslated field value']],
-      'langcode' => $default_langcode,
     ];
     $label_key = $entity_type_manager->getDefinition($this->entityTypeId)
       ->getKey('label');
     if ($label_key) {
       $values[$label_key] = [['value' => $this->randomMachineName()]];
     }
-    $id = $this->createEntity($values, $default_langcode);
+    $id = $this->createEntity($values, $this->langcodes[0]);
     $storage = $entity_type_manager->getStorage($this->entityTypeId);
     $storage->resetCache([$id]);
     $this->entity = $storage->load($id);
 
-    // "translate editable entities" is a new permission added in Drupal 9.1.0.
-    // See change notice: https://www.drupal.org/node/2975283.
-
     // Create a translation.
-    if (!$this->translator) {
-      $this->translator = $this->drupalCreateUser([
-        'view test entity translations',
-        'translate editable entities',
-        'access contextual links',
-        'configure any layout',
-        'create content translations',
-        'administer nodes',
-        'administer node fields',           // Ensures field administration access.
-        'administer node display',
-        'administer languages',
-        'administer content types',
-        'access administration pages',
-        'administer site configuration',
-        'administer modules',
-        'administer content translation',
-        'administer url aliases',
-        'create url aliases',
-        'translate any entity',  
-      ]);
-
-      $this->translator->addRole('administrator');
-      $this->translator->save();
-    } 
-    
+    $this->drupalLogin($this->translator);
     $add_translation_url = Url::fromRoute("entity.$this->entityTypeId.content_translation_add", [
       $this->entityTypeId => $this->entity->id(),
-      'source' => $default_langcode,
-      'target' => $second_langcode,
+      'source' => $this->langcodes[0],
+      'target' => $this->langcodes[2],
     ]);
-
     $this->drupalGet($add_translation_url);
-    $response_status = $this->getSession()->getStatusCode();
-    $this->assertEquals(200, $response_status, 'Expected a 200 OK status, if not 200 then either something is not installed/configured or there\'s incorrect permissions assigned to this user.');
     $this->submitForm([
       "{$this->fieldName}[0][value]" => 'The translated field value',
     ], 'Save');
@@ -368,30 +298,12 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
    * Set up the View Display.
    */
   protected function setUpViewDisplay() {
-    $bundle = $this->bundle;
-    if (!$bundle) {
-      $bundle = 'entity_test_mul';
-    }
-    $targetEntityType = $this->entityTypeId;
-    if (!$targetEntityType) {
-      $targetEntityType = 'node';
-    }
-
-    // Create the bundle if it doesn't exist.
-    if (!\Drupal::entityTypeManager()->getStorage($targetEntityType)->load($bundle)) {
-      \Drupal::entityTypeManager()->getStorage($targetEntityType)->create([
-        'id' => $bundle,
-        'label' => ucfirst($bundle),
-      ])->save();
-    }
-
     EntityViewDisplay::create([
-      'targetEntityType' => $targetEntityType,
-      'bundle' => $bundle,
+      'targetEntityType' => $this->entityTypeId,
+      'bundle' => $this->bundle,
       'mode' => 'default',
       'status' => TRUE,
-    ])->setComponent($this->fieldName, ['type' => 'string'])
-      ->save();
+    ])->setComponent($this->fieldName, ['type' => 'string'])->save();
   }
 
 }
diff --git a/tests/src/Functional/Rest/OverrideSectionsTest.php b/tests/src/Functional/Rest/OverrideSectionsTest.php
index 1ef13c0..93582f4 100644
--- a/tests/src/Functional/Rest/OverrideSectionsTest.php
+++ b/tests/src/Functional/Rest/OverrideSectionsTest.php
@@ -55,11 +55,19 @@ class OverrideSectionsTest extends LayoutRestTestBase {
       Url::fromRoute('rest.entity.node.GET', ['node' => $this->node->id()])
     );
     $expected_cache_tags = [
-        'config:filter.format.plain_text',
-        'config:rest.resource.entity.node',
-        'http_response',
-        'node:1',
+      'config:filter.format.plain_text',
+      'config:rest.resource.entity.node',
+      'http_response',
+      'node:1',
     ];
+    // Drupal 8 has the rest.settings config object, and its cache tags are
+    // expected to be present in the response. In Drupal 9, the config does not
+    // exist.
+    // @todo Remove this when Drupal 9 is the minimum supported version of core.
+    $rest_settings = $this->config('rest.settings');
+    if (!$rest_settings->isNew()) {
+      $expected_cache_tags = Cache::mergeTags($expected_cache_tags, $rest_settings->getCacheTags());
+    }
     $this->assertResourceResponse(
       200,
       FALSE,
diff --git a/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php b/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
index 49a2458..eda8056 100644
--- a/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
+++ b/tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
@@ -29,7 +29,7 @@ class InlineBlockTranslationTest extends InlineBlockTestBase {
   protected static $modules = [
     'content_translation',
     'field_ui',
-    'layout_builder_st'
+    'layout_builder_st',
   ];
 
   /**
@@ -53,12 +53,12 @@ class InlineBlockTranslationTest extends InlineBlockTestBase {
 
     $this->drupalLogin($this->drupalCreateUser([
       'access contextual links',
-      'administer blocks',
       'configure any layout',
       'administer node display',
       'administer node fields',
       'translate bundle_with_section_field node',
       'create content translations',
+      'create and edit custom blocks',
     ]));
 
     // Allow layout overrides.
diff --git a/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php b/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php
index b5d3af7..2b5a8c8 100644
--- a/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php
+++ b/tests/src/FunctionalJavascript/JavascriptTranslationTestTrait.php
@@ -35,10 +35,10 @@ trait JavascriptTranslationTestTrait {
 
     $translation_selector_prefix = $this->usingConfigTranslation ? '#drupal-off-canvas .translation-set ' : '#drupal-off-canvas ';
     $this->clickContextualLink($block_selector, 'Translate block');
-    $label_input = $assert_session->waitForElementVisible('css', $translation_selector_prefix. '[name="translation[label]"]');
+    $label_input = $assert_session->waitForElementVisible('css', $translation_selector_prefix . '[name="translation[label]"]');
     $this->assertNotEmpty($label_input);
     $this->assertEquals($expected_label, $label_input->getValue());
-    $assert_session->elementTextContains('css', $translation_selector_prefix. '.form-item-source-label', $untranslated_label);
+    $assert_session->elementTextContains('css', $translation_selector_prefix . '.form-item-source-label', $untranslated_label);
     $label_input->setValue($new_label);
     foreach ($unexpected_element_selectors as $unexpected_element_selector) {
       $assert_session->elementNotExists('css', $unexpected_element_selector);
diff --git a/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php b/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php
index ba0a3e9..2df4a45 100644
--- a/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php
+++ b/tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php
@@ -62,7 +62,7 @@ trait LayoutBuilderTestTrait {
    * @param string $message
    *   (optional) Custom message to display with the assertion.
    *
-   * @todo: Remove after https://www.drupal.org/project/drupal/issues/2892440
+   * @todo Remove after https://www.drupal.org/project/drupal/issues/2892440
    */
   public function assertNoElementAfterWait($selector, $timeout = 10000, $message = '') {
     $page = $this->getSession()->getPage();
diff --git a/tests/src/FunctionalJavascript/TranslationTest.php b/tests/src/FunctionalJavascript/TranslationTest.php
index da96cdf..9e6044b 100644
--- a/tests/src/FunctionalJavascript/TranslationTest.php
+++ b/tests/src/FunctionalJavascript/TranslationTest.php
@@ -67,7 +67,6 @@ class TranslationTest extends WebDriverTestBase {
       $this->container->get('module_installer')->install(['layout_builder_st']);
     }
 
-
     $page = $this->getSession()->getPage();
     $assert_session = $this->assertSession();
 
@@ -115,7 +114,7 @@ class TranslationTest extends WebDriverTestBase {
     // Update the translations block label.
     $this->drupalGet('it/node/1/layout');
     $this->assertNonTranslationActionsRemoved();
-    $this->updateBlockTranslation('.block-system-powered-by-block', 'untranslated label', 'label updated in translation','label in translation');
+    $this->updateBlockTranslation('.block-system-powered-by-block', 'untranslated label', 'label updated in translation', 'label in translation');
 
     $assert_session->buttonExists('Save layout');
     $page->pressButton('Save layout');
@@ -138,7 +137,7 @@ class TranslationTest extends WebDriverTestBase {
 
     $this->createContentType([
       'type' => 'bundle_with_section_field',
-      'new_revision' => TRUE
+      'new_revision' => TRUE,
     ]);
     $this->createNode([
       'type' => 'bundle_with_section_field',
-- 
GitLab

