Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`LinksHandlerTrait` still uses `WITH` for an arbitrary join, which deprecated since Doctrine ORM 3.6 (follow-up to #8394)

Open Beginner friendly
#8,649 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
backend

Research direction

Start at src/Doctrine/Orm/State/LinksHandlerTrait.php around lines 121-128, where an entity-class join is built with the 'WITH' keyword; read the original analysis in issue #8394 to see which Link configurations reach this branch. Check how the installed doctrine/orm version can be detected (ORM's UPGRADE.md documents the deprecation under 3.6) and swap to Join::ON for versions that accept it while keeping 'WITH' for doctrine/orm ^2.17 || ^3.3. Done looks like: no deprecation notice from Parser.php when querying a subresource Link against doctrine/orm 3.7, and existing Doctrine ORM tests still pass.

Written by the indexing model from the issue text.

Description

API Platform version(s) affected: 4.3.21, and the current heads of 4.4, 5.0 and main

This is follow-up to ticket #8394. The stale bot closed it on 2026-09-15 as "not planned", without any additional info and the code has not changed on 4.4, 5.0 or main so the problem still exists:
https://github.com/api-platform/core/blob/main/src/Doctrine/Orm/State/LinksHandlerTrait.php#L121-L128

$queryBuilder->join(
    $fromClass,
    $joinAlias,
    'WITH',
    "$previousAlias.{$previousJoinProperties[0]} = $joinAlias.{$associationMapping['fieldName']}"
);

This joins an entity class, not an association, so doctrine/orm 3.6+ reports:

Using WITH for the join condition of arbitrary joins is deprecated. Use ON instead. (Parser.php:1677 called by Parser.php:1549, https://github.com/doctrine/orm/issues/12192, package doctrine/orm)

I hit it on 4.3.21 with doctrine/orm 3.7.3 through a subresource Link. The original report in #8394 has a full analysis of which links take this branch.

Possible solution

Possible fix is to use Join::ON for this join on doctrine/orm versions that accept ON for arbitrary joins (ORM's UPGRADE.md lists the deprecation under 3.6), and keep 'WITH' for older versions, since API Platform still allows doctrine/orm ^2.17 || ^3.3.

I can open a PR for this if the proposed approach would fit.

Dominant language
PHP
Stars
2.6k
Forks
987
Avg merge
1d 9h
Merged PRs (30d)
91

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from api-platform/core

All issues in api-platform/core

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.