diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php
index 643c422..6ed4843 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\field\Tests\EntityReference;
 
 use Drupal\Core\Entity\Entity;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\field_ui\Tests\FieldUiTestTrait;
 use Drupal\node\Entity\Node;
 use Drupal\simpletest\WebTestBase;
@@ -235,7 +236,12 @@ public function testFieldAdminHandler() {
       'field_name' => $field_name,
     );
     $this->drupalPostForm($bundle_path . '/fields/add-field', $edit, t('Save and continue'));
-    $this->drupalPostForm(NULL, array(), t('Save field settings'));
+
+    // Set to unlimited.
+    $edit = array(
+      'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
+    );
+    $this->drupalPostForm(NULL, $edit, t('Save field settings'));
 
     // Add the view to the test field.
     $edit = array(
@@ -268,6 +274,17 @@ public function testFieldAdminHandler() {
     $this->assertRaw($node1->getTitle() . ' (' . $node1->id() . ')');
     $this->assertRaw($node2->getTitle() . ' (' . $node2->id() . ')');
 
+    // Try to add a new node, fill the entity reference field and submit the
+    // form.
+    $this->drupalPostForm('node/add/' . $this->type, [], t('Add another item'));
+    $edit = array(
+      'title[0][value]' => 'Example',
+      'field_test_entity_ref_field[0][target_id]' => 'Foo Node (' . $node1->id() . ')',
+      'field_test_entity_ref_field[1][target_id]' => 'Foo Node (' . $node2->id() . ')',
+    );
+    $this->drupalPostForm(NULL, $edit, t('Save'));
+    $this->assertResponse(200);
+
     $edit = array(
       'title[0][value]' => 'Example',
       'field_test_entity_ref_field[0][target_id]' => 'Test'
diff --git a/core/modules/views/src/Plugin/views/display/EntityReference.php b/core/modules/views/src/Plugin/views/display/EntityReference.php
index 9e142fa..de2c085 100644
--- a/core/modules/views/src/Plugin/views/display/EntityReference.php
+++ b/core/modules/views/src/Plugin/views/display/EntityReference.php
@@ -150,7 +150,7 @@ public function query() {
 
     // Add an IN condition for validation.
     if (!empty($options['ids'])) {
-      $this->view->query->addWhere(0, $id_field, $options['ids']);
+      $this->view->query->addWhere(0, $id_field, $options['ids'], 'IN');
     }
 
     $this->view->setItemsPerPage($options['limit']);
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index 83cd4b4..85356fc 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -805,9 +805,9 @@ public function clearFields() {
    *   complex options, it is an array. The meaning of each element in the array is
    *   dependent on the $operator.
    * @param $operator
-   *   The comparison operator, such as =, <, or >=. It also accepts more complex
-   *   options such as IN, LIKE, or BETWEEN. Defaults to IN if $value is an array
-   *   = otherwise. If $field is a string you have to use 'formula' here.
+   *   The comparison operator, such as =, <, or >=. It also accepts more
+   *   complex options such as IN, LIKE, LIKE BINARY, or BETWEEN. Defaults to =.
+   *   If $field is a string you have to use 'formula' here.
    *
    * The $field, $value and $operator arguments can also be passed in with a
    * single DatabaseCondition object, like this:
