diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 596c879..c8b9eda 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\Entity; use Drupal\Core\Entity\EntityStorageControllerInterface; -use Drupal\Core\Config\ConfigUUIDException; +use Drupal\Core\Config\ConfigDuplicateUUIDException; /** * Defines a base configuration entity class. @@ -176,14 +176,14 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { ->execute(); $matched_entity = reset($matching_entities); if (!empty($matched_entity) && ($matched_entity != $this->id())) { - throw new ConfigUUIDException(format_string('Attempt to save a configuration object %id with UUID %uuid when this UUID is already used for %matched', array('%id' => $this->id(), '%uuid' => $this->uuid(), '%matched' => $matched_entity))); + throw new ConfigDuplicateUUIDException(format_string('Attempt to save a configuration entity %id with UUID %uuid when this UUID is already used for %matched', array('%id' => $this->id(), '%uuid' => $this->uuid(), '%matched' => $matched_entity))); } if (!$this->isNew()) { $original = $storage_controller->loadUnchanged($this->id()); // Ensure that the UUID cannot be changed for an existing entity. if ($original && ($original->uuid() != $this->uuid())) { - throw new ConfigUUIDException(format_string('Attempt to save a configuration entity %id with UUID %uuid when this entity already exists with UUID %original_uuid', array('%id' => $this->id(), '%uuid' => $this->uuid(), '%original_uuid' => $original->uuid()))); + throw new ConfigDuplicateUUIDException(format_string('Attempt to save a configuration entity %id with UUID %uuid when this entity already exists with UUID %original_uuid', array('%id' => $this->id(), '%uuid' => $this->uuid(), '%original_uuid' => $original->uuid()))); } } } diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php index efb9a14..c4bb60a 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php @@ -9,7 +9,7 @@ use Drupal\simpletest\DrupalUnitTestBase; use Drupal\Component\Uuid\Uuid; -use Drupal\Core\Config\ConfigUUIDException; +use Drupal\Core\Config\ConfigDuplicateUUIDException; /** * Tests importing config entity data when the ID or UUID matches existing data. @@ -52,7 +52,7 @@ public function testUUIDConflict() { $entity->save(); $this->fail('Exception thrown when attempting to save a configuration entity with a UUID that does not match the existing UUID.'); } - catch (ConfigUUIDException $e) { + catch (ConfigDuplicateUUIDException $e) { $this->pass(format_string('Exception thrown when attempting to save a configuration entity with a UUID that does not match existing data: %e.', array('%e' => $e))); }