Issue #3491256 by amateescu: Improve the exception message for unsupported entity types in a workspace
parent
57061f4d39
commit
2b63c15d87
|
@ -130,7 +130,7 @@ class EntityOperations implements ContainerInjectionInterface {
|
|||
// Disallow any change to an unsupported entity when we are not in the
|
||||
// default workspace.
|
||||
if (!$this->workspaceInfo->isEntitySupported($entity)) {
|
||||
throw new \RuntimeException('This entity can only be saved in the default workspace.');
|
||||
throw new \RuntimeException(sprintf('The "%s" entity type can only be saved in the default workspace.', $entity->getEntityTypeId()));
|
||||
}
|
||||
|
||||
/** @var \Drupal\Core\Entity\ContentEntityInterface|\Drupal\Core\Entity\EntityPublishedInterface $entity */
|
||||
|
|
|
@ -172,7 +172,7 @@ class WorkspaceInformationTest extends KernelTestBase {
|
|||
|
||||
// Check that unsupported entity types can not be saved in a workspace.
|
||||
$this->expectException(EntityStorageException::class);
|
||||
$this->expectExceptionMessage('This entity can only be saved in the default workspace.');
|
||||
$this->expectExceptionMessage('The "entity_test" entity type can only be saved in the default workspace.');
|
||||
$entity->save();
|
||||
}
|
||||
|
||||
|
|
|
@ -690,7 +690,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
|
|||
|
||||
if (!$allowed) {
|
||||
$this->expectException(EntityStorageException::class);
|
||||
$this->expectExceptionMessage('This entity can only be saved in the default workspace.');
|
||||
$this->expectExceptionMessage("The \"$entity_type_id\" entity type can only be saved in the default workspace.");
|
||||
}
|
||||
$entity->save();
|
||||
}
|
||||
|
@ -721,7 +721,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
|
|||
|
||||
if (!$allowed) {
|
||||
$this->expectException(EntityStorageException::class);
|
||||
$this->expectExceptionMessage('This entity can only be saved in the default workspace.');
|
||||
$this->expectExceptionMessage("The \"$entity_type_id\" entity type can only be saved in the default workspace.");
|
||||
}
|
||||
$entity->save();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue