From 4311b80c2a70fbd584db8eaa8bc133de1bfed1c2 Mon Sep 17 00:00:00 2001
From: Aaron Bauman <260-aaronbauman@users.noreply.drupalcode.org>
Date: Fri, 6 Sep 2024 19:16:01 +0000
Subject: [PATCH] Issue #3449141: Drupal 11

---
 .gitlab-ci.yml                                |  5 +++
 composer.json                                 | 12 +++---
 .../salesforce_address.info.yml               |  2 +-
 .../salesforce_example.info.yml               |  2 +-
 .../salesforce_example.services.yml           |  2 +-
 .../SalesforceExampleSubscriber.php           | 23 ++++++++--
 .../salesforce_jwt/salesforce_jwt.info.yml    |  2 +-
 .../salesforce_logger.info.yml                |  2 +-
 modules/salesforce_mapping/composer.json      |  6 +--
 .../schema/salesforce_mapping.schema.yml      |  4 +-
 .../salesforce_mapping.info.yml               |  2 +-
 .../src/Entity/MappedObject.php               | 12 +++---
 .../MappingEntityTypeConstraintValidator.php  |  2 +-
 .../Constraint/UniqueFieldsConstraint.php     |  6 +--
 .../tests/src/Unit/MappedObjectTest.php       | 27 ++++++------
 .../src/Unit/SalesforceMappingStorageTest.php |  2 +-
 .../tests/src/Unit/SalesforceMappingTest.php  |  2 +-
 .../salesforce_mapping_ui.info.yml            |  2 +-
 .../src/Form/MappedObjectDeleteForm.php       |  9 +++-
 .../src/Form/SalesforceMappingFormBase.php    | 17 ++++++++
 .../Tests/SalesforceMappingCrudFormTest.php   |  2 +-
 .../salesforce_oauth.info.yml                 |  2 +-
 .../salesforce_pull/salesforce_pull.info.yml  |  2 +-
 .../src/Commands/SalesforcePullCommands.php   |  6 +--
 .../tests/src/Unit/DeleteHandlerTest.php      |  4 +-
 .../tests/src/Unit/PullBaseTest.php           |  4 +-
 modules/salesforce_push/composer.json         |  2 +-
 .../salesforce_push/salesforce_push.info.yml  |  2 +-
 .../tests/src/Unit/PushQueueTest.php          |  2 +-
 .../SalesforcePushQueueProcessorRestTest.php  | 13 +++---
 .../salesforce_soap/salesforce_soap.info.yml  |  2 +-
 modules/salesforce_webform/composer.json      |  2 +-
 .../salesforce_webform.info.yml               |  2 +-
 .../salesforce_webform.module                 |  1 +
 salesforce.info.yml                           |  2 +-
 src/Form/SalesforceAuthSettings.php           | 31 ++++----------
 src/Form/SettingsForm.php                     | 42 ++++---------------
 src/Rest/RestResponseDescribe.php             |  7 ++++
 src/SalesforceAuthProviderPluginBase.php      |  3 +-
 .../salesforce_test_rest_client.info.yml      |  2 +-
 tests/src/Unit/RestClientTest.php             |  2 +-
 41 files changed, 147 insertions(+), 129 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d9d2f219..9b0a72a2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,3 +5,8 @@ include:
       - '/includes/include.drupalci.main.yml'
       - '/includes/include.drupalci.variables.yml'
       - '/includes/include.drupalci.workflows.yml'
+variables:
+  OPT_IN_TEST_MAX_PHP: 1
+  # Broaden test coverage.
+  OPT_IN_TEST_NEXT_MINOR: 1
+  OPT_IN_TEST_NEXT_MAJOR: 1
\ No newline at end of file
diff --git a/composer.json b/composer.json
index 9838024b..081604bc 100644
--- a/composer.json
+++ b/composer.json
@@ -27,18 +27,18 @@
   "extra": {
     "drush": {
       "services": {
-        "drush.services.yml": "^9 || ^10 || ^11"
+        "drush.services.yml": ">=9"
       }
     }
   },
   "require": {
-    "consolidation/output-formatters": "^3.2.0 || ^4.1",
+    "consolidation/output-formatters": "^3.2.0 || ^4.5",
     "lusitanian/oauth": "^0.8.11",
     "firebase/php-jwt": "^5.0 || ^6.0",
-    "drupal/address": "^1.8 || ^2.0",
-    "drupal/key": "^1.14",
-    "drupal/dynamic_entity_reference": "^1.9 || ^2.0 || ^3 || ^4",
-    "drupal/typed_data": "^2.1",
+    "drupal/address": "^2.0",
+    "drupal/key": "^1",
+    "drupal/dynamic_entity_reference": "^3 || ^4",
+    "drupal/typed_data": "^2",
     "messageagency/force.com-toolkit-for-php": "^1.0.2",
     "ext-soap": "*",
     "ext-json": "*"
diff --git a/modules/salesforce_address/salesforce_address.info.yml b/modules/salesforce_address/salesforce_address.info.yml
index fcfcb4fb..0036544d 100644
--- a/modules/salesforce_address/salesforce_address.info.yml
+++ b/modules/salesforce_address/salesforce_address.info.yml
@@ -1,7 +1,7 @@
 name: Salesforce Address
 type: module
 description: A custom Address Field Widget for Salesforce compatibility.
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 package: Salesforce
 dependencies:
   - address:address
diff --git a/modules/salesforce_example/salesforce_example.info.yml b/modules/salesforce_example/salesforce_example.info.yml
index bd5a054a..edcd9724 100644
--- a/modules/salesforce_example/salesforce_example.info.yml
+++ b/modules/salesforce_example/salesforce_example.info.yml
@@ -1,7 +1,7 @@
 name: Salesforce Example
 type: module
 description: Salesforce Examples
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 package: Salesforce
 dependencies:
   - salesforce:salesforce_push
diff --git a/modules/salesforce_example/salesforce_example.services.yml b/modules/salesforce_example/salesforce_example.services.yml
index 439b2de6..5a117323 100644
--- a/modules/salesforce_example/salesforce_example.services.yml
+++ b/modules/salesforce_example/salesforce_example.services.yml
@@ -1,6 +1,6 @@
 services:
   salesforce_example.push_params:
     class: Drupal\salesforce_example\EventSubscriber\SalesforceExampleSubscriber
-    arguments: []
+    arguments: ['@salesforce.client', '@logger.factory','@messenger']
     tags:
       - { name: event_subscriber }
diff --git a/modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php b/modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php
index 15face96..eef600d4 100644
--- a/modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php
+++ b/modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php
@@ -5,13 +5,16 @@
 namespace Drupal\salesforce_example\EventSubscriber;
 
 use Drupal\Core\File\FileSystemInterface;
+use Drupal\Core\Messenger\MessengerInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\salesforce\Event\SalesforceEvents;
+use Drupal\salesforce\Rest\RestClientInterface;
 use Drupal\salesforce_mapping\Event\SalesforcePullEvent;
 use Drupal\salesforce_mapping\Event\SalesforcePushAllowedEvent;
 use Drupal\salesforce_mapping\Event\SalesforcePushOpEvent;
 use Drupal\salesforce_mapping\Event\SalesforcePushParamsEvent;
 use Drupal\salesforce_mapping\Event\SalesforceQueryEvent;
+use Psr\Log\LoggerInterface;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 
 /**
@@ -40,6 +43,13 @@ class SalesforceExampleSubscriber implements EventSubscriberInterface {
    */
   protected $client;
 
+  /**
+   * The messenger.
+   *
+   * @var \Drupal\Core\Messenger\MessengerInterface
+   */
+  protected $messenger;
+
   /**
    * Create a new Salesforce object.
    *
@@ -47,10 +57,17 @@ class SalesforceExampleSubscriber implements EventSubscriberInterface {
    *   The logger.
    * @param \Drupal\salesforce\Rest\RestClientInterface $salesforce_client
    *   The factory for configuration objects.
+   * @param \Drupal\Core\Messenger\MessengerInterface $messenger
+   *   The messenger.
    */
-  public function __construct(LoggerInterface $logger, RestClientInterface $salesforce_client) {
+  public function __construct(
+    LoggerInterface $logger,
+    RestClientInterface $salesforce_client,
+    MessengerInterface $messenger,
+  ) {
     $this->logger = $logger;
     $this->client = $salesforce_client;
+    $this->messenger = $messenger;
   }
 
   /**
@@ -185,7 +202,7 @@ class SalesforceExampleSubscriber implements EventSubscriberInterface {
         }
         catch (\Exception $e) {
           // Unable to fetch file data from SF.
-          $this->logger('db')->error($this->t('failed to fetch attachment for user @user', ['@user' => $account->id()]));
+          $this->logger->error($this->t('failed to fetch attachment for user @user', ['@user' => $account->id()]));
           return;
         }
 
@@ -198,7 +215,7 @@ class SalesforceExampleSubscriber implements EventSubscriberInterface {
           $account->user_picture->target_id = $file->id();
         }
         else {
-          $this->logger('db')->error('failed to save profile pic for user ' . $account->id());
+          $this->logger->error('failed to save profile pic for user ' . $account->id());
         }
 
         break;
diff --git a/modules/salesforce_jwt/salesforce_jwt.info.yml b/modules/salesforce_jwt/salesforce_jwt.info.yml
index 40cbec66..799cb154 100644
--- a/modules/salesforce_jwt/salesforce_jwt.info.yml
+++ b/modules/salesforce_jwt/salesforce_jwt.info.yml
@@ -1,7 +1,7 @@
 name: Salesforce JWT Auth Provider
 type: module
 description: Provides key-based Salesforce authentication.
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 package: Salesforce
 configure: salesforce.auth_config
 dependencies:
diff --git a/modules/salesforce_logger/salesforce_logger.info.yml b/modules/salesforce_logger/salesforce_logger.info.yml
index d281c2d5..631568d6 100644
--- a/modules/salesforce_logger/salesforce_logger.info.yml
+++ b/modules/salesforce_logger/salesforce_logger.info.yml
@@ -1,7 +1,7 @@
 name: Salesforce Logger
 type: module
 description: Consolidated logging for Salesforce Log events.
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 package: Salesforce
 configure: salesforce_logger.settings
 dependencies:
diff --git a/modules/salesforce_mapping/composer.json b/modules/salesforce_mapping/composer.json
index 8a47be29..70619633 100644
--- a/modules/salesforce_mapping/composer.json
+++ b/modules/salesforce_mapping/composer.json
@@ -9,13 +9,13 @@
     }
   ],
   "require": {
-    "drupal/dynamic_entity_reference": "^1.9 || ^2.0 || ^3 || ^4",
-    "drupal/typed_data": "^1.0-beta2"
+    "drupal/dynamic_entity_reference": "^3 || ^4",
+    "drupal/typed_data": "^2.1"
   },
   "extra": {
     "drush": {
       "services": {
-        "drush.services.yml": "^9 || ^10 || ^11"
+        "drush.services.yml": ">=9"
       }
     }
   }
diff --git a/modules/salesforce_mapping/config/schema/salesforce_mapping.schema.yml b/modules/salesforce_mapping/config/schema/salesforce_mapping.schema.yml
index 16b49031..117b8b97 100644
--- a/modules/salesforce_mapping/config/schema/salesforce_mapping.schema.yml
+++ b/modules/salesforce_mapping/config/schema/salesforce_mapping.schema.yml
@@ -50,8 +50,10 @@ salesforce_mapping.salesforce_mapping.*:
       type: string
       label: 'Pull query SOQL "WHERE" clause'
     pull_record_type_filter:
-      type: mapping
+      type: sequence
       label: 'Pull query record type filter'
+      sequence:
+        type: string
     sync_triggers:
       type: mapping
       label: 'Sync triggers'
diff --git a/modules/salesforce_mapping/salesforce_mapping.info.yml b/modules/salesforce_mapping/salesforce_mapping.info.yml
index 315758d3..a311fbe6 100644
--- a/modules/salesforce_mapping/salesforce_mapping.info.yml
+++ b/modules/salesforce_mapping/salesforce_mapping.info.yml
@@ -2,7 +2,7 @@ name: Salesforce Mapping
 type: module
 description: Map Drupal entities to Salesforce objects.
 package: Salesforce
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 dependencies:
   - salesforce:salesforce
   - dynamic_entity_reference:dynamic_entity_reference
diff --git a/modules/salesforce_mapping/src/Entity/MappedObject.php b/modules/salesforce_mapping/src/Entity/MappedObject.php
index b3d6e5b0..0f58901c 100644
--- a/modules/salesforce_mapping/src/Entity/MappedObject.php
+++ b/modules/salesforce_mapping/src/Entity/MappedObject.php
@@ -139,6 +139,8 @@ class MappedObject extends RevisionableContentEntityBase implements MappedObject
    * {@inheritdoc}
    */
   public function pruneRevisions(EntityStorageInterface $storage) {
+    /** @var \Drupal\Core\Entity\RevisionableStorageInterface $entityStorage */
+    $entityStorage = $storage;
     $limit = $this
       ->config('salesforce.settings')
       ->get('limit_mapped_object_revisions');
@@ -146,7 +148,7 @@ class MappedObject extends RevisionableContentEntityBase implements MappedObject
       // Limit 0 means no limit.
       return $this;
     }
-    $count = $storage
+    $count = $entityStorage
       ->getQuery()
       ->accessCheck(FALSE)
       ->allRevisions()
@@ -158,7 +160,7 @@ class MappedObject extends RevisionableContentEntityBase implements MappedObject
     if ($count <= $limit) {
       return $this;
     }
-    $vids_to_delete = $storage
+    $vids_to_delete = $entityStorage
       ->getQuery()
       ->accessCheck(FALSE)
       ->allRevisions()
@@ -170,14 +172,14 @@ class MappedObject extends RevisionableContentEntityBase implements MappedObject
       return $this;
     }
     foreach ($vids_to_delete as $vid => $dummy) {
-      /** @var \Drupal\Core\Entity\RevisionableInterface $revision */
-      if ($revision = $storage->loadRevision($vid)) {
+      
+      if ($revision = $entityStorage->loadRevision($vid)) {
         // Prevent deletion if this is the default revision.
         if ($revision->isDefaultRevision()) {
           continue;
         }
       }
-      $storage->deleteRevision($vid);
+      $entityStorage->deleteRevision($vid);
     }
     return $this;
   }
diff --git a/modules/salesforce_mapping/src/Plugin/Validation/Constraint/MappingEntityTypeConstraintValidator.php b/modules/salesforce_mapping/src/Plugin/Validation/Constraint/MappingEntityTypeConstraintValidator.php
index d6bab519..eabf2cb7 100644
--- a/modules/salesforce_mapping/src/Plugin/Validation/Constraint/MappingEntityTypeConstraintValidator.php
+++ b/modules/salesforce_mapping/src/Plugin/Validation/Constraint/MappingEntityTypeConstraintValidator.php
@@ -13,7 +13,7 @@ class MappingEntityTypeConstraintValidator extends ConstraintValidator {
   /**
    * {@inheritdoc}
    */
-  public function validate($entity, Constraint $constraint) {
+  public function validate(mixed $entity, Constraint $constraint) {
     $drupal_entity = $entity->getMappedEntity() ?: $entity->getDrupalEntityStub();
     if (!$drupal_entity) {
       $this->context->addViolation('Validation failed. Please check your input and try again.');
diff --git a/modules/salesforce_mapping/src/Plugin/Validation/Constraint/UniqueFieldsConstraint.php b/modules/salesforce_mapping/src/Plugin/Validation/Constraint/UniqueFieldsConstraint.php
index 0693a63a..2d5dd3fa 100644
--- a/modules/salesforce_mapping/src/Plugin/Validation/Constraint/UniqueFieldsConstraint.php
+++ b/modules/salesforce_mapping/src/Plugin/Validation/Constraint/UniqueFieldsConstraint.php
@@ -32,21 +32,21 @@ class UniqueFieldsConstraint extends Constraint {
   /**
    * {@inheritdoc}
    */
-  public function getRequiredOptions() {
+  public function getRequiredOptions(): array {
     return ['fields'];
   }
 
   /**
    * {@inheritdoc}
    */
-  public function getDefaultOption() {
+  public function getDefaultOption(): ?string {
     return 'fields';
   }
 
   /**
    * {@inheritdoc}
    */
-  public function validatedBy() {
+  public function validatedBy(): string {
     return '\Drupal\salesforce_mapping\Plugin\Validation\Constraint\UniqueFieldsConstraintValidator';
   }
 
diff --git a/modules/salesforce_mapping/tests/src/Unit/MappedObjectTest.php b/modules/salesforce_mapping/tests/src/Unit/MappedObjectTest.php
index 2dfc95d3..53670c12 100644
--- a/modules/salesforce_mapping/tests/src/Unit/MappedObjectTest.php
+++ b/modules/salesforce_mapping/tests/src/Unit/MappedObjectTest.php
@@ -97,32 +97,32 @@ class MappedObjectTest extends UnitTestCase {
       ->getMock();
     $this->entityType->expects($this->any())
       ->method('getKeys')
-      ->will($this->returnValue([
+      ->willReturn([
         'id' => 'id',
         'uuid' => 'uuid',
-      ]));
+      ]);
 
     $this->etm = $this->getMockBuilder(EntityTypeManagerInterface::class)
       ->getMock();
     $this->etm->expects($this->any())
       ->method('getDefinition')
       ->with($this->entityTypeId)
-      ->will($this->returnValue($this->entityType));
+      ->willReturn($this->entityType);
 
     $this->mappedObjectEntityType = $this->getMockBuilder(EntityTypeInterface::class)
       ->getMock();
     $this->mappedObjectEntityType->expects($this->any())
       ->method('getKeys')
-      ->will($this->returnValue([
+      ->willReturn([
         'id' => 'id',
         'entity_id' => 'entity_id',
         'salesforce_id' => 'salesforce_id',
-      ]));
+      ]);
 
     $this->etm->expects($this->any())
       ->method('getDefinition')
       ->with('salesforce_mapped_object')
-      ->will($this->returnValue($this->mappedObjectEntityType));
+      ->willReturn($this->mappedObjectEntityType);
 
     $this->event_dispatcher = $this->getMockBuilder(EventDispatcherInterface::class)
       ->getMock();
@@ -135,14 +135,13 @@ class MappedObjectTest extends UnitTestCase {
       ->getMock();
     $this->fieldTypePluginManager->expects($this->any())
       ->method('getDefaultStorageSettings')
-      ->will($this->returnValue([]));
+      ->willReturn([]);
     $this->fieldTypePluginManager->expects($this->any())
       ->method('getDefaultFieldSettings')
-      ->will($this->returnValue([]));
+      ->willReturn([]);
     $this->fieldTypePluginManager->expects($this->any())
       ->method('createFieldItemList')
-      ->will($this->returnValue(
-        $this->getMockBuilder(FieldItemListInterface::class)->getMock()));
+      ->willReturn($this->getMockBuilder(FieldItemListInterface::class)->getMock());
 
     $this->time = $this->getMockBuilder(TimeInterface::CLASS)->getMock();
 
@@ -184,7 +183,7 @@ class MappedObjectTest extends UnitTestCase {
 
     $this->mapped_object = $this->getMockBuilder(MappedObject::CLASS)
       ->disableOriginalConstructor()
-      ->setMethods([
+      ->onlyMethods([
         'getMappedEntity',
         'getMapping',
         'getEntityType',
@@ -225,7 +224,7 @@ class MappedObjectTest extends UnitTestCase {
       ->willReturn(FALSE);
     $this->mapping->expects($this->any())
       ->method('hasKey')
-      ->will($this->returnValue(TRUE));
+      ->willReturn(TRUE);
     $this->client->expects($this->once())
       ->method('objectUpsert')
       ->willReturn(NULL);
@@ -256,7 +255,7 @@ class MappedObjectTest extends UnitTestCase {
     // Third pass: test create.
     $this->mapping->expects($this->once())
       ->method('hasKey')
-      ->will($this->returnValue(FALSE));
+      ->willReturn(FALSE);
     $this->mapped_object->expects($this->any())
       ->method('sfid')
       ->willReturn(FALSE);
@@ -285,7 +284,7 @@ class MappedObjectTest extends UnitTestCase {
       ->willReturn(TRUE);
     $this->mapping->expects($this->once())
       ->method('hasKey')
-      ->will($this->returnValue(TRUE));
+      ->willReturn(TRUE);
     $this->client->expects($this->once())
       ->method('objectUpsert')
       ->willReturn(NULL);
diff --git a/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingStorageTest.php b/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingStorageTest.php
index d22ab8cb..62c2c7d3 100644
--- a/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingStorageTest.php
+++ b/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingStorageTest.php
@@ -109,7 +109,7 @@ class SalesforceMappingStorageTest extends UnitTestCase {
         $this->etm,
       ])
       ->disableOriginalConstructor()
-      ->setMethods(['loadByProperties'])
+      ->onlyMethods(['loadByProperties'])
       ->getMock();
   }
 
diff --git a/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingTest.php b/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingTest.php
index b1579483..ea2042d1 100644
--- a/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingTest.php
+++ b/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingTest.php
@@ -145,7 +145,7 @@ class SalesforceMappingTest extends UnitTestCase {
     \Drupal::setContainer($container);
 
     $this->mapping = $this->getMockBuilder(SalesforceMapping::CLASS)
-      ->setMethods(['fieldManager'])
+      ->onlyMethods(['fieldManager'])
       ->setConstructorArgs([$this->values, $this->entityTypeId])
       ->getMock();
     $this->mapping->expects($this->any())
diff --git a/modules/salesforce_mapping_ui/salesforce_mapping_ui.info.yml b/modules/salesforce_mapping_ui/salesforce_mapping_ui.info.yml
index 36068302..39b03777 100644
--- a/modules/salesforce_mapping_ui/salesforce_mapping_ui.info.yml
+++ b/modules/salesforce_mapping_ui/salesforce_mapping_ui.info.yml
@@ -2,7 +2,7 @@ name: Salesforce Mapping UI
 type: module
 description: User interface for managing Salesforce mappings.
 package: Salesforce
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 configure: entity.salesforce_mapping.list
 dependencies:
   - salesforce:salesforce_mapping
diff --git a/modules/salesforce_mapping_ui/src/Form/MappedObjectDeleteForm.php b/modules/salesforce_mapping_ui/src/Form/MappedObjectDeleteForm.php
index 34fc379a..038facd5 100644
--- a/modules/salesforce_mapping_ui/src/Form/MappedObjectDeleteForm.php
+++ b/modules/salesforce_mapping_ui/src/Form/MappedObjectDeleteForm.php
@@ -12,7 +12,7 @@ use Drupal\Core\Url;
 use Drupal\salesforce\Event\SalesforceEvents;
 use Drupal\salesforce\Event\SalesforceNoticeEvent;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
 
 /**
  * Provides a form for deleting a salesforce_mapped_oject entity.
@@ -21,6 +21,13 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  */
 class MappedObjectDeleteForm extends ContentEntityConfirmFormBase {
 
+  /**
+   * An event dispatcher instance to use for configuration events.
+   *
+   * @var \Symfony\Contracts\EventDispatcher\EventDispatcherInterface
+   */
+  protected $eventDispatcher;
+
   /**
    * {@inheritdoc}
    */
diff --git a/modules/salesforce_mapping_ui/src/Form/SalesforceMappingFormBase.php b/modules/salesforce_mapping_ui/src/Form/SalesforceMappingFormBase.php
index 6ee4288a..4c1d7ddc 100644
--- a/modules/salesforce_mapping_ui/src/Form/SalesforceMappingFormBase.php
+++ b/modules/salesforce_mapping_ui/src/Form/SalesforceMappingFormBase.php
@@ -182,4 +182,21 @@ abstract class SalesforceMappingFormBase extends EntityForm {
     return $sfobject_options;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function buildEntity(array $form, FormStateInterface $form_state) {
+    $entity = parent::buildEntity($form, $form_state);
+    $record_types = $form_state->getValue('pull_record_type_filter');
+    if (!empty($record_types)) {
+      $record_types = array_filter($record_types);
+      if (!empty($record_types)) {
+        $record_types = array_values($record_types);
+      }
+    }
+    $entity->set('pull_record_type_filter', $record_types ?? []);
+    return $entity;
+  }
+
+
 }
diff --git a/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php b/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php
index 44f96515..0a1dc66d 100644
--- a/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php
+++ b/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php
@@ -91,7 +91,7 @@ class SalesforceMappingCrudFormTest extends BrowserTestBase {
       'salesforce_object_type' => 'Contact',
     ];
     $this->submitForm($post, 'Save');
-    $this->assertSession()->fieldValueEquals('label', $post['label']);
+    $this->assertSession()->pageTextContains($post['label']);
 
     // Test simply adding a field plugin of every possible type. This is not
     // great coverage, but will at least make sure our plugin definitions don't
diff --git a/modules/salesforce_oauth/salesforce_oauth.info.yml b/modules/salesforce_oauth/salesforce_oauth.info.yml
index ade4562c..69a53745 100644
--- a/modules/salesforce_oauth/salesforce_oauth.info.yml
+++ b/modules/salesforce_oauth/salesforce_oauth.info.yml
@@ -1,7 +1,7 @@
 name: Salesforce OAuth user-agent Provider
 type: module
 description: Provides user-agent-based Salesforce OAuth authentication.
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 package: Salesforce
 configure: salesforce.auth_config
 dependencies:
diff --git a/modules/salesforce_pull/salesforce_pull.info.yml b/modules/salesforce_pull/salesforce_pull.info.yml
index 50f2c7e0..15828f54 100644
--- a/modules/salesforce_pull/salesforce_pull.info.yml
+++ b/modules/salesforce_pull/salesforce_pull.info.yml
@@ -2,6 +2,6 @@ name: Salesforce Pull
 type: module
 description: Imports objects from Salesforce based on mappings defined in Salesforce Mapping.
 package: Salesforce
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 dependencies:
   - salesforce:salesforce_mapping
diff --git a/modules/salesforce_pull/src/Commands/SalesforcePullCommands.php b/modules/salesforce_pull/src/Commands/SalesforcePullCommands.php
index 5018f6a4..b28778cf 100644
--- a/modules/salesforce_pull/src/Commands/SalesforcePullCommands.php
+++ b/modules/salesforce_pull/src/Commands/SalesforcePullCommands.php
@@ -2,7 +2,6 @@
 
 namespace Drupal\salesforce_pull\Commands;
 
-use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\salesforce\Event\SalesforceEvents;
 use Drupal\salesforce\Rest\RestClient;
@@ -14,6 +13,7 @@ use Drupal\salesforce_mapping\Event\SalesforceQueryEvent;
 use Drupal\salesforce_pull\QueueHandler;
 use Symfony\Component\Console\Input\Input;
 use Symfony\Component\Console\Output\Output;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 /**
  * A Drush commandfile.
@@ -55,13 +55,13 @@ class SalesforcePullCommands extends SalesforceMappingCommandsBase {
    *   Token storage.
    * @param \Drupal\salesforce_pull\QueueHandler $pullQueue
    *   Pull queue handler service.
-   * @param \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher $eventDispatcher
+   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher
    *   Event dispatcher service.
    *
    * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
    * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
    */
-  public function __construct(RestClient $client, EntityTypeManagerInterface $etm, SalesforceAuthProviderPluginManagerInterface $auth_man, SalesforceAuthTokenStorageInterface $token_storage, QueueHandler $pullQueue, ContainerAwareEventDispatcher $eventDispatcher) {
+  public function __construct(RestClient $client, EntityTypeManagerInterface $etm, SalesforceAuthProviderPluginManagerInterface $auth_man, SalesforceAuthTokenStorageInterface $token_storage, QueueHandler $pullQueue, EventDispatcherInterface $eventDispatcher) {
     parent::__construct($client, $etm, $auth_man, $token_storage);
     $this->pullQueue = $pullQueue;
     $this->eventDispatcher = $eventDispatcher;
diff --git a/modules/salesforce_pull/tests/src/Unit/DeleteHandlerTest.php b/modules/salesforce_pull/tests/src/Unit/DeleteHandlerTest.php
index 3167ffd2..edf4dbf4 100644
--- a/modules/salesforce_pull/tests/src/Unit/DeleteHandlerTest.php
+++ b/modules/salesforce_pull/tests/src/Unit/DeleteHandlerTest.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\salesforce_pull\Unit;
 
-use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher;
+use Symfony\Component\EventDispatcher\EventDispatcher;
 use Drupal\Core\Entity\EntityStorageBase;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\State\StateInterface;
@@ -180,7 +180,7 @@ class DeleteHandlerTest extends UnitTestCase {
     $this->state = $prophecy->reveal();
 
     // Mock event dispatcher.
-    $prophecy = $this->prophesize(ContainerAwareEventDispatcher::CLASS);
+    $prophecy = $this->prophesize(EventDispatcher::CLASS);
     $prophecy->dispatch(Argument::any(), Argument::any())
       ->willReturnArgument(0);
     $this->ed = $prophecy->reveal();
diff --git a/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php b/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php
index f8f3e556..cc029ee9 100644
--- a/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php
+++ b/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php
@@ -85,7 +85,7 @@ class PullBaseTest extends UnitTestCase {
 
     // Mock StringItem for mock Entity.
     $changed_value = $this->getMockBuilder(StringItem::CLASS)
-      ->setMethods(['__get'])
+      ->onlyMethods(['__get'])
       ->disableOriginalConstructor()
       // ->setConstructorArgs([$ddi,null,null])
       ->getMock();
@@ -96,7 +96,7 @@ class PullBaseTest extends UnitTestCase {
 
     // Mock content entity.
     $this->entity = $this->getMockBuilder(ContentEntityBase::CLASS)
-      ->setMethods(['__construct', '__get', '__set', 'label', 'id', '__isset'])
+      ->onlyMethods(['__construct', '__get', '__set', 'label', 'id', '__isset'])
       ->disableOriginalConstructor()
       ->getMock();
     $this->entity->expects($this->any())
diff --git a/modules/salesforce_push/composer.json b/modules/salesforce_push/composer.json
index ee4c4b95..6704813b 100644
--- a/modules/salesforce_push/composer.json
+++ b/modules/salesforce_push/composer.json
@@ -11,7 +11,7 @@
     "extra": {
         "drush": {
             "services": {
-                "drush.services.yml": "^9 || ^10 || ^11"
+                "drush.services.yml": ">=9"
             }
         }
     }
diff --git a/modules/salesforce_push/salesforce_push.info.yml b/modules/salesforce_push/salesforce_push.info.yml
index 9f0ac3e2..e363c2eb 100644
--- a/modules/salesforce_push/salesforce_push.info.yml
+++ b/modules/salesforce_push/salesforce_push.info.yml
@@ -2,6 +2,6 @@ name: Salesforce Push
 type: module
 description: Push data to Salesforce when updates are made to Drupal entities.
 package: Salesforce
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 dependencies:
   - salesforce:salesforce_mapping
diff --git a/modules/salesforce_push/tests/src/Unit/PushQueueTest.php b/modules/salesforce_push/tests/src/Unit/PushQueueTest.php
index 2a6e1ca6..37285636 100644
--- a/modules/salesforce_push/tests/src/Unit/PushQueueTest.php
+++ b/modules/salesforce_push/tests/src/Unit/PushQueueTest.php
@@ -210,7 +210,7 @@ class PushQueueTest extends UnitTestCase {
       ->willReturn($this->worker);
 
     $this->queue = $this->getMockBuilder(PushQueue::class)
-      ->setMethods([
+      ->onlyMethods([
         'claimItems',
         'setName',
         'garbageCollection',
diff --git a/modules/salesforce_push/tests/src/Unit/SalesforcePushQueueProcessorRestTest.php b/modules/salesforce_push/tests/src/Unit/SalesforcePushQueueProcessorRestTest.php
index b8dddabd..ed9bfacf 100644
--- a/modules/salesforce_push/tests/src/Unit/SalesforcePushQueueProcessorRestTest.php
+++ b/modules/salesforce_push/tests/src/Unit/SalesforcePushQueueProcessorRestTest.php
@@ -76,6 +76,7 @@ class SalesforcePushQueueProcessorRestTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp(): void {
+    parent::setUp();
     $this->entityType = 'default';
 
     $this->queue = $this->getMockBuilder(PushQueueInterface::CLASS)->getMock();
@@ -159,7 +160,7 @@ class SalesforcePushQueueProcessorRestTest extends UnitTestCase {
       ->willReturn(NULL);
 
     $this->handler = $this->getMockBuilder(Rest::class)
-      ->setMethods(['processItem'])
+      ->onlyMethods(['processItem'])
       ->setConstructorArgs([
         [],
         '',
@@ -180,7 +181,7 @@ class SalesforcePushQueueProcessorRestTest extends UnitTestCase {
    */
   public function testProcessSuccess() {
     $this->handler = $this->getMockBuilder(Rest::class)
-      ->setMethods(['processItem'])
+      ->onlyMethods(['processItem'])
       ->setConstructorArgs([
         [],
         '',
@@ -218,7 +219,7 @@ class SalesforcePushQueueProcessorRestTest extends UnitTestCase {
         $this->eventDispatcher,
         $this->authMan,
       ])
-      ->setMethods(['getMappedObject'])
+      ->onlyMethods(['getMappedObject'])
       ->getMock();
 
     $mappedObject = $this->getMockBuilder(MappedObjectInterface::class)
@@ -257,7 +258,7 @@ class SalesforcePushQueueProcessorRestTest extends UnitTestCase {
       ->willReturn(NULL);
 
     $this->handler = $this->getMockBuilder(Rest::class)
-      ->setMethods(['getMappedObject'])
+      ->onlyMethods(['getMappedObject'])
       ->setConstructorArgs([
         [],
         '',
@@ -316,7 +317,7 @@ class SalesforcePushQueueProcessorRestTest extends UnitTestCase {
       ->willReturn(NULL);
 
     $this->handler = $this->getMockBuilder(Rest::class)
-      ->setMethods(['getMappedObject'])
+      ->onlyMethods(['getMappedObject'])
       ->setConstructorArgs([
         [],
         '',
@@ -369,7 +370,7 @@ class SalesforcePushQueueProcessorRestTest extends UnitTestCase {
       ->willReturn(NULL);
 
     $this->handler = $this->getMockBuilder(Rest::class)
-      ->setMethods(['getMappedObject'])
+      ->onlyMethods(['getMappedObject'])
       ->setConstructorArgs([
         [],
         '',
diff --git a/modules/salesforce_soap/salesforce_soap.info.yml b/modules/salesforce_soap/salesforce_soap.info.yml
index 177d3323..e13e5af2 100644
--- a/modules/salesforce_soap/salesforce_soap.info.yml
+++ b/modules/salesforce_soap/salesforce_soap.info.yml
@@ -2,6 +2,6 @@ name: Salesforce Soap
 type: module
 description: Exposes a SoapClient service for communicating with the Salesforce SOAP API.
 package: Salesforce
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 dependencies:
   - salesforce:salesforce
diff --git a/modules/salesforce_webform/composer.json b/modules/salesforce_webform/composer.json
index ca37d48d..791ec822 100644
--- a/modules/salesforce_webform/composer.json
+++ b/modules/salesforce_webform/composer.json
@@ -11,7 +11,7 @@
     "extra": {
         "drush": {
             "services": {
-                "drush.services.yml": "^9 || ^10 || ^11"
+                "drush.services.yml": ">=9"
             }
         }
     }
diff --git a/modules/salesforce_webform/salesforce_webform.info.yml b/modules/salesforce_webform/salesforce_webform.info.yml
index 28e48f24..b62ffce5 100644
--- a/modules/salesforce_webform/salesforce_webform.info.yml
+++ b/modules/salesforce_webform/salesforce_webform.info.yml
@@ -2,7 +2,7 @@ name: Salesforce Webform
 type: module
 description: Adds support for webforms fields in Salesforce Mapping.
 package: Salesforce
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 
 dependencies:
   - salesforce:salesforce_mapping
diff --git a/modules/salesforce_webform/salesforce_webform.module b/modules/salesforce_webform/salesforce_webform.module
index 0768ba45..b572fe85 100644
--- a/modules/salesforce_webform/salesforce_webform.module
+++ b/modules/salesforce_webform/salesforce_webform.module
@@ -29,6 +29,7 @@ function salesforce_webform_menu_local_tasks_alter(&$data, $route_name) {
         $tab_route_parameters = $url->getRouteParameters();
 
         if (strpos($tab_route_name, 'entity.webform_submission.salesforce') !== 0) {
+          /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */
           $webform_submission = WebformSubmission::load($tab_route_parameters['webform_submission']);
           $url->setRouteParameter('webform', $webform_submission->getWebform()->id());
         }
diff --git a/salesforce.info.yml b/salesforce.info.yml
index 89b76e0b..b854b810 100644
--- a/salesforce.info.yml
+++ b/salesforce.info.yml
@@ -2,5 +2,5 @@ name: Salesforce Integration
 type: module
 description: Modules to integrate Drupal and Salesforce
 package: Salesforce
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 configure: salesforce.admin_config_salesforce
diff --git a/src/Form/SalesforceAuthSettings.php b/src/Form/SalesforceAuthSettings.php
index cdf10041..645fb270 100644
--- a/src/Form/SalesforceAuthSettings.php
+++ b/src/Form/SalesforceAuthSettings.php
@@ -2,20 +2,18 @@
 
 namespace Drupal\salesforce\Form;
 
-use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\salesforce\Event\SalesforceEvents;
 use Drupal\salesforce\Event\SalesforceNoticeEvent;
-use Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 /**
  * Class auth settings for salesforce.
  */
 class SalesforceAuthSettings extends ConfigFormBase {
 
+
   /**
    * Auth provider plugin manager service.
    *
@@ -30,31 +28,16 @@ class SalesforceAuthSettings extends ConfigFormBase {
    */
   protected $eventDispatcher;
 
-  /**
-   * Constructs a \Drupal\system\ConfigFormBase object.
-   *
-   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
-   *   Config.
-   * @param \Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface $salesforceAuth
-   *   Authman.
-   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher
-   *   Events.
-   */
-  public function __construct(ConfigFactoryInterface $config_factory, SalesforceAuthProviderPluginManagerInterface $salesforceAuth, EventDispatcherInterface $eventDispatcher) {
-    parent::__construct($config_factory);
-    $this->salesforceAuth = $salesforceAuth;
-    $this->eventDispatcher = $eventDispatcher;
-  }
-
   /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('config.factory'),
-      $container->get('plugin.manager.salesforce.auth_providers'),
-      $container->get('event_dispatcher')
-    );
+    $instance = parent::create($container);
+    
+    $instance->salesforceAuth = $container->get('plugin.manager.salesforce.auth_providers');
+    $instance->eventDispatcher = $container->get('event_dispatcher');
+    
+    return $instance;
   }
 
   /**
diff --git a/src/Form/SettingsForm.php b/src/Form/SettingsForm.php
index 835f1ab6..214a6612 100644
--- a/src/Form/SettingsForm.php
+++ b/src/Form/SettingsForm.php
@@ -2,16 +2,11 @@
 
 namespace Drupal\salesforce\Form;
 
-use Drupal\Core\Config\ConfigFactoryInterface;
-use Drupal\Core\Config\TypedConfigManagerInterface;
-use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\State\StateInterface;
 use Drupal\Core\Url;
 use Drupal\salesforce\Rest\RestClientInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 /**
  * Creates authorization form for Salesforce.
@@ -28,17 +23,10 @@ class SettingsForm extends ConfigFormBase {
   /**
    * The sevent dispatcher service..
    *
-   * @var \Drupal\Core\State\StateInterface
+   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
    */
   protected $eventDispatcher;
 
-  /**
-   * Typed config.
-   *
-   * @var \Drupal\Core\Config\TypedConfigManagerInterface
-   */
-  protected $typedConfigManager;
-
   /**
    * Module handler.
    *
@@ -53,30 +41,18 @@ class SettingsForm extends ConfigFormBase {
    */
   protected $state;
 
-  /**
-   * {@inheritdoc}
-   */
-  public function __construct(ConfigFactoryInterface $config_factory, RestClientInterface $salesforce_client, EventDispatcherInterface $event_dispatcher, TypedConfigManagerInterface $typedConfigManager, ModuleHandlerInterface $moduleHandler, StateInterface $state) {
-    parent::__construct($config_factory);
-    $this->client = $salesforce_client;
-    $this->eventDispatcher = $event_dispatcher;
-    $this->typedConfigManager = $typedConfigManager;
-    $this->moduleHandler = $moduleHandler;
-    $this->state = $state;
-  }
-
   /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('config.factory'),
-      $container->get('salesforce.client'),
-      $container->get('event_dispatcher'),
-      $container->get('config.typed'),
-      $container->get('module_handler'),
-      $container->get('state')
-    );
+    $instance = parent::create($container);
+    
+    $instance->client = $container->get('salesforce.client');
+    $instance->eventDispatcher = $container->get('event_dispatcher');
+    $instance->moduleHandler = $container->get('module_handler');
+    $instance->state = $container->get('state');
+    
+    return $instance;
   }
 
   /**
diff --git a/src/Rest/RestResponseDescribe.php b/src/Rest/RestResponseDescribe.php
index 157c738e..af34ab68 100644
--- a/src/Rest/RestResponseDescribe.php
+++ b/src/Rest/RestResponseDescribe.php
@@ -170,6 +170,13 @@ class RestResponseDescribe extends RestResponse {
     $this->$key = $value;
   }
 
+  /**
+   * Magic isset checker.
+   */
+  public function __isset($property){
+    return isset($this->$property);
+  }
+
   /**
    * Getter for name.
    *
diff --git a/src/SalesforceAuthProviderPluginBase.php b/src/SalesforceAuthProviderPluginBase.php
index 56d250a1..a13c6329 100644
--- a/src/SalesforceAuthProviderPluginBase.php
+++ b/src/SalesforceAuthProviderPluginBase.php
@@ -8,6 +8,7 @@ use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Messenger\MessengerTrait;
 use Drupal\Core\Routing\TrustedRedirectResponse;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
+use Drupal\Core\Utility\Error;
 use Drupal\salesforce\Rest\SalesforceIdentity;
 use Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface;
 use OAuth\Common\Http\Client\ClientInterface;
@@ -200,7 +201,7 @@ abstract class SalesforceAuthProviderPluginBase extends Salesforce implements Sa
       $this->refreshIdentity($token);
     }
     catch (\Exception $e) {
-      watchdog_exception('salesforce', $e);
+      Error::logException(\Drupal::logger('salesforce'), $e);
       $this->messenger()->addError($e->getMessage());
       $form_state->disableRedirect();
       return FALSE;
diff --git a/tests/modules/salesforce_test_rest_client/salesforce_test_rest_client.info.yml b/tests/modules/salesforce_test_rest_client/salesforce_test_rest_client.info.yml
index 089e512b..82585cb2 100644
--- a/tests/modules/salesforce_test_rest_client/salesforce_test_rest_client.info.yml
+++ b/tests/modules/salesforce_test_rest_client/salesforce_test_rest_client.info.yml
@@ -2,6 +2,6 @@ name: 'Salesforce Test Rest Client'
 type: module
 description: 'Provides a dummy Rest Client for functional tests.'
 package: Testing
-core_version_requirement: ^10.3
+core_version_requirement: ^10.3 || ^11
 dependencies:
   - salesforce:salesforce
diff --git a/tests/src/Unit/RestClientTest.php b/tests/src/Unit/RestClientTest.php
index 3cc8f1fb..14c3a344 100644
--- a/tests/src/Unit/RestClientTest.php
+++ b/tests/src/Unit/RestClientTest.php
@@ -139,7 +139,7 @@ class RestClientTest extends UnitTestCase {
 
     $this->client = $this
       ->getMockBuilder(RestClient::CLASS)
-      ->setMethods($methods)
+      ->onlyMethods($methods)
       ->setConstructorArgs($args)
       ->getMock();
 
-- 
GitLab