Skip to content

Commit

Permalink
Update handleXmlHttpRequestSuccessResponse and handleXmlHttpRequestEr…
Browse files Browse the repository at this point in the history
…rorResponse deprecation message.
  • Loading branch information
Jeroen van den Nieuwenhuisen committed Oct 28, 2020
1 parent 0ad5420 commit 4937d3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/CRUDController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ final protected function trans($id, array $parameters = [], $domain = null, $loc
protected function handleXmlHttpRequestErrorResponse(Request $request, FormInterface $form): ?JsonResponse
{
if (empty(array_intersect(['application/json', '*/*'], $request->getAcceptableContentTypes()))) {
@trigger_error('In next major version response will return 406 NOT ACCEPTABLE without `Accept: application/json` or `Accept: */*`', E_USER_DEPRECATED);
@trigger_error(sprintf('%s is not supported since sonata-project/admin-bundle 3.x and will return 406 in 4.0. Use `application/json`.', implode(',', $request->getAcceptableContentTypes())));

return null;
}
Expand All @@ -1580,7 +1580,7 @@ protected function handleXmlHttpRequestErrorResponse(Request $request, FormInter
protected function handleXmlHttpRequestSuccessResponse(Request $request, $object): JsonResponse
{
if (empty(array_intersect(['application/json', '*/*'], $request->getAcceptableContentTypes()))) {
@trigger_error('In next major version response will return 406 NOT ACCEPTABLE without `Accept: application/json` or `Accept: */*`', E_USER_DEPRECATED);
@trigger_error(sprintf('%s is not supported since sonata-project/admin-bundle 3.x and will return 406 in 4.0. Use `application/json`.', implode(',', $request->getAcceptableContentTypes())));
}

return $this->renderJson([
Expand Down

0 comments on commit 4937d3d

Please sign in to comment.