Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#8,649 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
backend

調査の方向性

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

api-platform/core のほかの issue

api-platform/core の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。