Merge branch 'master' into upgrade-sf5

This commit is contained in:
2024-02-12 21:50:34 +01:00
920 changed files with 6430 additions and 1914 deletions

View File

@@ -137,7 +137,7 @@ class ApiController extends AbstractCRUDController
try {
$entity = $this->deserialize($action, $request, $_format, $entity);
} catch (NotEncodableValueException $e) {
throw new BadRequestHttpException('invalid json', 400, $e);
throw new BadRequestHttpException('invalid json', $e, 400);
}
$errors = $this->validate($action, $request, $_format, $entity);
@@ -155,7 +155,7 @@ class ApiController extends AbstractCRUDController
return $response;
}
$this->managerRegistry->getManager()->flush();
$this->managerRegistry->getManagerForClass($this->getEntityClass())->flush();
$response = $this->onAfterFlush($action, $request, $_format, $entity, $errors);
@@ -177,7 +177,7 @@ class ApiController extends AbstractCRUDController
public function indexApi(Request $request, string $_format)
{
return match ($request->getMethod()) {
Request::METHOD_GET, REQUEST::METHOD_HEAD => $this->indexApiAction('_index', $request, $_format),
Request::METHOD_GET, Request::METHOD_HEAD => $this->indexApiAction('_index', $request, $_format),
default => throw $this->createNotFoundException('This method is not supported'),
};
}