only in patch2: unchanged: --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -267,7 +267,12 @@ function entity_revision_delete($entity_type, $revision_id) { */ function entity_load_by_uuid($entity_type_id, $uuid, $reset = FALSE) { $entity_type = \Drupal::entityManager()->getDefinition($entity_type_id); - if (!$uuid_key = $entity_type->getKey('uuid')) { + + // Configuration entities do not use annotations to set the UUID key. + if (is_subclass_of($entity_type->getClass(), 'Drupal\Core\Config\Entity\ConfigEntityBase')) { + $uuid_key = 'uuid'; + } + elseif (!$uuid_key = $entity_type->getKey('uuid')) { throw new EntityStorageException("Entity type $entity_type_id does not support UUIDs."); } only in patch2: unchanged: --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php @@ -78,6 +78,13 @@ public function testStorageControllerMethods() { )); $entity->save(); + // Ensure that the configuration entity can be loaded by UUID. + $entity_loaded_by_uuid = entity_load_by_uuid($entity_type->id(), $entity->uuid()); + // Compare UUIDs as the objects are not identical since + // $entity->enforceIsNew is FALSE and $entity_loaded_by_uuid->enforceIsNew + // is NULL. + $this->assertIdentical($entity->uuid(), $entity_loaded_by_uuid->uuid()); + $entities = $this->storage->loadByProperties(); $this->assertEqual(count($entities), 3, 'Three entities are loaded when no properties are specified.');