You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improved recursion handling in EagerLoadingExtension (api-platform#4377)
* feat: Avoid eager joining back to the just visited parent
* fix: Remove unnecessary duplicate select statement
This exact select statement is already added a few lines above. The only
exception is when fetchPartial is active, and in that case the current
implementation is wrong anyways, because it always adds the full select.
When this "temporary" solution for avoiding recursion was implemented,
the duplicated line above was not yet there:
https://github.com/api-platform/core/blob/5ba518014e2770e1ad5686b0124b2db45245fee5/src/Bridge/Doctrine/Orm/Extension/EagerLoadingExtension.php#L148
But later, the duplicated statement was added, and the select statement
inside the "Avoid recursion" case was made obsolete:
api-platform@e34427a
* refactor(eager loading): Avoid joining unnecessary recursive relations
* fix: prevent adding same alias twice; doctrine does not like it
Co-authored-by: Pirmin Mattmann <[email protected]>
thrownewRuntimeException('The total number of joined relations has exceeded the specified maximum. Raise the limit if necessary with the "api_platform.eager_loading.max_joins" configuration key (https://api-platform.com/docs/core/performance/#eager-loading), or limit the maximum serialization depth using the "enable_max_depth" option of the Symfony serializer (https://symfony.com/doc/current/components/serializer.html#handling-serialization-depth).');
@@ -229,8 +231,17 @@ private function joinRelations(QueryBuilder $queryBuilder, QueryNameGeneratorInt
0 commit comments