diff --git a/src/Query/Tables.php b/src/Query/Tables.php
index c95d842..5e24294 100644
--- a/src/Query/Tables.php
+++ b/src/Query/Tables.php
@@ -15,10 +15,11 @@ class Tables extends BaseTables {
    * {@inheritdoc}
    */
   protected function addNextBaseTable(EntityType $entity_type, $table, $sql_column) {
+    $field_storage = func_get_arg(3);
     // Parent method is overridden in order to choose the correct column to
     // join on (string or int).
     $entity_type_id_key = $entity_type->getKey('id');
-    if ($entity_type_id_key !== FALSE) {
+    if (($field_storage->getType() === 'dynamic_entity_reference') && ($entity_type_id_key !== FALSE)) {
       if (DynamicEntityReferenceItem::entityHasIntegerId($entity_type->id())) {
         $sql_column .= '_int';
       }
diff --git a/tests/modules/dynamic_entity_reference_entity_test/dynamic_entity_reference_entity_test.module b/tests/modules/dynamic_entity_reference_entity_test/dynamic_entity_reference_entity_test.module
index ebb6b4d..f0bc1cd 100644
--- a/tests/modules/dynamic_entity_reference_entity_test/dynamic_entity_reference_entity_test.module
+++ b/tests/modules/dynamic_entity_reference_entity_test/dynamic_entity_reference_entity_test.module
@@ -58,6 +58,14 @@ function dynamic_entity_reference_entity_test_entity_base_field_info(EntityTypeI
       $fields['der'] = BaseFieldDefinition::createFromFieldStorageDefinition($fields['dynamic_references'])
         ->setName('der');
     }
+
+    // Adds a normal entity reference field if set to do so.
+    if (\Drupal::state()->get('dynamic_entity_reference_entity_test_with_normal', FALSE)) {
+      $fields['normal_reference'] = BaseFieldDefinition::create('entity_reference')
+        ->setLabel(t('Entity ID'))
+        ->setDescription(t('The referenced ID of the entity.'))
+        ->setRequired(TRUE);
+    }
   }
 
   return $fields;
diff --git a/tests/src/Kernel/DynamicEntityReferenceBaseFieldTest.php b/tests/src/Kernel/DynamicEntityReferenceBaseFieldTest.php
index ef4b59b..f325694 100644
--- a/tests/src/Kernel/DynamicEntityReferenceBaseFieldTest.php
+++ b/tests/src/Kernel/DynamicEntityReferenceBaseFieldTest.php
@@ -297,4 +297,39 @@ class DynamicEntityReferenceBaseFieldTest extends EntityKernelTestBase {
     $this->assertSame($int_column, $str_column);
   }
 
+  /**
+   * Test entity field query with normal entity reference and DER base fields.
+   */
+  public function testEntityFieldQuery() {
+    \Drupal::state()->set('dynamic_entity_reference_entity_test_with_two_base_fields', TRUE);
+    \Drupal::state()->set('dynamic_entity_reference_entity_test_with_normal', TRUE);
+    $this->enableModules(['dynamic_entity_reference_entity_test']);
+    \Drupal::entityDefinitionUpdateManager()->applyUpdates();
+    $this->installEntitySchema('entity_test_mul');
+
+    // Add some users and test entities.
+    $accounts = $entities = [];
+    foreach (range(1, 3) as $i) {
+      $accounts[$i] = $this->createUser();
+      $entity = EntityTestMul::create();
+
+      // Add reference to user 2 for entities 2 and 3.
+      if ($i > 1) {
+        $entity->normal_reference = $accounts[2];
+      }
+
+      $entity->save();
+      $entities[$i] = $entity;
+    }
+
+    $result = \Drupal::entityTypeManager()->getStorage('entity_test_mul')->getQuery()
+      ->condition('normal_reference.entity:user.status', 1)
+      ->execute();
+    $expected = [
+      $accounts[2]->id() => $accounts[2]->id(),
+      $accounts[3]->id() => $accounts[3]->id(),
+    ];
+    $this->assertSame($expected, $result);
+  }
+
 }
diff --git a/tests/src/Kernel/DynamicEntityReferenceFieldTest.php b/tests/src/Kernel/DynamicEntityReferenceFieldTest.php
index 88d7d11..50b2ea5 100644
--- a/tests/src/Kernel/DynamicEntityReferenceFieldTest.php
+++ b/tests/src/Kernel/DynamicEntityReferenceFieldTest.php
@@ -4,6 +4,7 @@ namespace Drupal\Tests\dynamic_entity_reference\Kernel;
 
 use Drupal\config\Tests\SchemaCheckTestTrait;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\entity_test\Entity\EntityTest;
 use Drupal\entity_test\Entity\EntityTestBundle;
 use Drupal\entity_test\Entity\EntityTestStringId;
 use Drupal\field\Entity\FieldConfig;
@@ -472,4 +473,62 @@ class DynamicEntityReferenceFieldTest extends EntityKernelTestBase {
     $this->assertEquals($entities[1]->id(), $referenced_entity->id());
   }
 
+  /**
+   * Tests with normal entity reference fields.
+   */
+  public function testNormalEntityReference() {
+    // Create a field.
+    FieldStorageConfig::create([
+      'field_name' => 'field_normal_er',
+      'type' => 'entity_reference',
+      'entity_type' => $this->entityType,
+      'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
+      'settings' => [
+        'exclude_entity_types' => FALSE,
+        'entity_type_ids' => [
+          'user',
+        ],
+      ],
+    ])->save();
+
+    FieldConfig::create([
+      'field_name' => 'field_normal_er',
+      'entity_type' => $this->entityType,
+      'bundle' => $this->bundle,
+      'label' => 'Field test',
+      'settings' => [
+        $this->referencedEntityType => [
+          'handler' => 'default:user',
+          'handler_settings' => [
+            'target_bundles' => NULL,
+          ],
+        ],
+      ],
+    ])->save();
+
+    // Add some users and test entities.
+    $accounts = $entities = [];
+    foreach (range(1, 3) as $i) {
+      $accounts[$i] = $this->createUser();
+      $entity = EntityTest::create();
+
+      // Add reference to user 2 for entities 2 and 3.
+      if ($i > 1) {
+        $entity->field_normal_er = $accounts[2];
+      }
+
+      $entity->save();
+      $entities[$i] = $entity;
+    }
+
+    $result = \Drupal::entityTypeManager()->getStorage('entity_test')->getQuery()
+      ->condition('field_normal_er.entity:user.status', 1)
+      ->execute();
+    $expected = [
+      $accounts[2]->id() => $accounts[2]->id(),
+      $accounts[3]->id() => $accounts[3]->id(),
+    ];
+    $this->assertSame($expected, $result);
+  }
+
 }
