summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-04-30 09:15:26 (GMT)
committerAlex Pott2014-04-30 09:15:26 (GMT)
commite8ae773927b11c3384418fed3eb75a38962c89d0 (patch)
tree38a877fbe4cfdbecb31e341bce4e243f2f5917fb
parent4b172c72752df339a633e30aea1525c56be08192 (diff)
Issue #2236879 by andrei.dincu | tstoeckler: Broken condition in ContentEntityDatabaseStorage.
-rw-r--r--core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/ContentEntityDatabaseStorageTest.php8
2 files changed, 5 insertions, 5 deletions
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php b/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php
index 531d101..1a55637 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php
@@ -1137,7 +1137,7 @@ class ContentEntityDatabaseStorage extends ContentEntityStorageBase {
// Define the revision ID schema, default to integer if there is no revision
// ID.
- $revision_id_definition = $entity_type->hasKey('revision_id') ? $definitions[$entity_type->getKey('revision_id')] : NULL;
+ $revision_id_definition = $entity_type->hasKey('revision') ? $definitions[$entity_type->getKey('revision')] : NULL;
if (!$revision_id_definition || $revision_id_definition->getType() == 'integer') {
$revision_id_schema = array(
'type' => 'int',
diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityDatabaseStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityDatabaseStorageTest.php
index 41358a6..ef9bd2e 100644
--- a/core/tests/Drupal/Tests/Core/Entity/ContentEntityDatabaseStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityDatabaseStorageTest.php
@@ -52,11 +52,11 @@ class ContentEntityDatabaseStorageTest extends UnitTestCase {
->method('getKey')
->will($this->returnValueMap(array(
array('id', 'id'),
- array('revision_id', 'revision_id'),
+ array('revision', 'revision'),
)));
$definition->expects($this->once())
->method('hasKey')
- ->with('revision_id')
+ ->with('revision')
->will($this->returnValue(TRUE));
$field_type_manager->expects($this->exactly(2))
@@ -68,8 +68,8 @@ class ContentEntityDatabaseStorageTest extends UnitTestCase {
$fields['id'] = FieldDefinition::create('string')
->setName('id');
- $fields['revision_id'] = FieldDefinition::create('string')
- ->setName('revision_id');
+ $fields['revision'] = FieldDefinition::create('string')
+ ->setName('revision');
$entity_manager->expects($this->any())
->method('getDefinition')