[6.x]: Commerce can't boot without `craftcms/yii2-adapter`
メンテナーはふだん 1 日以内に返信
@lukeholder がすでに取り組んでいます。
2026年11月2日 から。
評価
調査の方向性
Start by reading HasLegacyBridges::finalizeLegacyRegistrationEvents() and the legacy services in src-yii2/services/OrderAdjustments.php and src-yii2/services/Carts.php; also check how craftcms/yii2-adapter is declared in composer.json. Reproduce on Craft 6 without the adapter and trace what loads during boot. Done means either Commerce boots without the adapter or Composer installs it as a required dependency.
索引モデルが issue の本文から書いたものです。
説明
What happened?
With craftcms/commerce 6.x-dev installed and enabled on a Craft 6 project that doesn't require craftcms/yii2-adapter, every request (site and control panel) fails with Class "yii\base\Component" not found.
HasLegacyBridges::finalizeLegacyRegistrationEvents() registers a booted() callback that always calls LegacyOrderAdjustments::finalizeRegistrationEvents() (and the Gateways / Purchasables equivalents). Those classes live in src-yii2/ and extend yii\base\Component. Guarding that callback with class_exists(\yii\base\Component::class) gets past it, but the legacy craft\commerce\services\Carts service is then loaded on every request and fails the same way.
Is the adapter meant to be a hard requirement of Commerce 6, or should Commerce run without it? It's in require-dev only, so a project gets it only if it requires the adapter itself. If it's required, listing it in require would let Composer install it.
Steps to reproduce
- Fresh Craft 6 project (6.x-dev) without
craftcms/yii2-adapter. composer require craftcms/commerce:6.x-dev, thenphp artisan craft:plugin:install commerce(succeeds).- Load any page.
Expected behavior
Commerce runs, or Composer installs the adapter as a dependency.
Actual behavior
HTTP 500 on every request: Class "yii\base\Component" not found at src-yii2/services/OrderAdjustments.php:16, then src-yii2/services/Carts.php:15.
Craft CMS version
6.x-dev (603f0e0); Commerce 6.x-dev (fa9aedd)
PHP version
8.5
Operating system and version
macOS (Laravel Herd)
Database type and version
MySQL 8
Image driver and version
—
Installed plugins and versions
craftcms/commerce 6.x-dev (plus one private plugin, not involved)
- 主要言語
- PHP
- スター
- 242
- フォーク
- 172
- 平均マージ
- 21時間 23分
- マージ済み PR(30日)
- 76
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
craftcms/commerce のほかの issue
-
[5.x]: `getInventoryLevel()` reads every inventory transaction of the location to return one itemオープンbug commerce5 Craft Commerce repo:commerce
難易度 4/5 1〜2日 初心者へのやさしさ 55/100
craftcms/commerce#4494 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[5.x]: Catalog pricing queue lock is held until the product save commits, so parallel saves run one at a time対応中かも @nfourtythree が 30 日前に担当しました。 オープンrepo:commerce
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
craftcms/commerce#4389 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
bug commerce5 Craft Commerce
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
craftcms/commerce#4264 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
💡 enhancement commerce5 Craft Commerce
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
craftcms/commerce#4156 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[4.x]: Multiple empty carts when refreshing fast with autoSetNewCartAddresses setting再び着手できるかも @lukeholder が 596 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug commerce4 Craft Commerce
craftcms/commerce#3973 · コメント 6 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
craftcms/commerce の issue をすべて見る
似ている issue
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpオープンenhancement feature: settings good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
nextcloud/integration_openai#480 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
a11y
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
omeka/plugin-Contribution#84 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
recca0120/vscode-phpunit#620 ·
メンテナーはふだん 1 日以内に返信