diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index 603fb35d80b29f0ad7f767d4535e50e199e47876..e4fb65a5688575210754833017cad92a4b247e12 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -993,7 +993,7 @@ protected function assertNormalizationEdgeCases($method, Url $url, array $reques // DX: 400 when no entity type bundle is specified. // @todo Change to 422 in https://www.drupal.org/node/2827084. $response = $this->request($method, $url, $request_options); - $this->assertResourceErrorResponse(400, 'A string must be provided as a bundle value.', $response); + $this->assertResourceErrorResponse(400, sprintf('Could not determine entity type bundle: "%s" field is missing.', $bundle_field_name), $response); } } diff --git a/core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php b/core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php index d97d3a4795550e87bb442a20c406c2d2e74a5fc7..c8211a8d5eecae426b147f9fea8b9d648756a230 100644 --- a/core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php +++ b/core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php @@ -95,7 +95,7 @@ protected function extractBundleData(array &$data, EntityTypeInterface $entity_t // Make sure a bundle has been provided. if (!is_string($bundle_value)) { - throw new UnexpectedValueException('A string must be provided as a bundle value.'); + throw new UnexpectedValueException(sprintf('Could not determine entity type bundle: "%s" field is missing.', $bundle_key)); } // Make sure the submitted bundle is a valid bundle for the entity type.