`LinksHandlerTrait` still uses `WITH` for an arbitrary join, which deprecated since Doctrine ORM 3.6 (follow-up to #8394)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
src/Doctrine/Orm/State/LinksHandlerTrait.php の 121〜128 行付近から始めましょう。そこでは 'WITH' キーワードを使ってエンティティクラスの結合が構築されています。どの Link 設定がこの分岐に到達するかは、issue #8394 の元の分析を読んで確認してください。インストール済みの doctrine/orm バージョンをどのように検出できるかを調べ(ORM の UPGRADE.md が 3.6 での非推奨を記載しています)、それを受け入れるバージョンでは Join::ON に切り替え、doctrine/orm ^2.17 || ^3.3 については 'WITH' を維持します。完成の条件は次のとおりです:doctrine/orm 3.7 に対してサブリソースの Link をクエリしても Parser.php から非推奨の通知が出ないこと、そして既存の Doctrine ORM テストが引き続き通ること。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- PHP
- スター
- 2.6k
- フォーク
- 987
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 90
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
api-platform/core のほかの issue
-
DeserializeProvider calls PartialDenormalizationException::getErrors(), deprecated in Symfony 8.1オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
api-platform/core#8650 ·
メンテナーはふだん 1 日以内に返信
-
`OrderExtension` and `OrderFilter` pass string sort directions, deprecated since `doctrine/orm` 3.7対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
api-platform/core#8648 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
api-platform/core#8647 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
api-platform/core#8612 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
api-platform/core#8655 ·
メンテナーはふだん 1 日以内に返信
api-platform/core の issue をすべて見る
似ている issue
-
extension/Commercial needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
crazy-goat/rabbit-stream#753 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
opensourcepos/opensourcepos#4743 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
grokability/snipe-it#19786 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 3 日以内に返信