Commit 0a3fb0a8 authored by catch's avatar catch

Issue #2838144 by arshadcn, Wim Leers, drpal: Update "bundle missing" error...

Issue #2838144 by arshadcn, Wim Leers, drpal: Update "bundle missing" error message in entity denormalization to indicate which field is actually missing
parent d6724f5a
......@@ -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);
}
}
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment