[6.x]: yii2-adapter: yii\db\Expression assigned to an ActiveRecord attribute becomes a JSON string
メンテナーはふだん 1 日以内に返信
@riasvdv がすでに取り組んでいます。
2026年10月13日 から。
評価
調査の方向性
Start by tracing how yii\db\Expression is handled when assigned to an ActiveRecord attribute and passed through update(), comparing the Craft 5 and Craft 6 behavior described here. Reproduce with the shown assignment and MySQL 8.4.5; done means the column receives the expression result (today + 1) rather than its JSON representation. The issue names no source file or test, so locating the relevant code and a regression test will take project familiarity.
索引モデルが issue の本文から書いたものです。
説明
What happened?
Description
I’m testing a plugin for Craft 6 via yii2-adapter. I found a behavior change with yii\db\Expression.
This code works in the previous Craft version:
$record->today = new \yii\db\Expression('today + 1');
$record->update();
in craft 5, var_dump($record->today) shows an Expression object:
object(yii\db\Expression)#572 (2) { ["expression"]=> string(9) "today + 1" ... }
In Craft 6, the same dump shows a JSON string:
string(38) "{"expression":"today + 1","params":[]}"
update() returns 1. But the column gets that JSON text, not today + 1. So the counter never increases.
I’m not sure this is related to Craft 6. It may be caused by something else in my setup or plugin.
Thanks!
Craft CMS version
6.0.0-alpha.20
PHP version
No response
Operating system and version
No response
Database type and version
MySQL 8.4.5
Image driver and version
No response
Installed plugins and versions
- vnali/craft-counter
- 主要言語
- PHP
- スター
- 3.6k
- フォーク
- 706
- 平均マージ
- 12時間 30分
- マージ済み PR(30日)
- 274
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
craftcms/cms のほかの issue
-
[6.x]: Colored chips: link blue has low contrast on tinted backgrounds対応中かも @brandonkelly が 1 日前に担当しました。 オープンbug repo:cms
craftcms/cms#19984 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
bug repo:cms
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
craftcms/cms#19980 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[6.x]: Text in some input fields is clipped at the bottom on Windows対応中かも @brianjhanson が 7 日前に担当しました。 オープンbug repo:cms
craftcms/cms#19928 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
bug repo:cms
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
craftcms/cms#19916 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[6.x]: AdminTable not available for plugin index and settings screens対応中かも @brianjhanson が 8 日前に担当しました。 オープンbug repo:cms
craftcms/cms#19912 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
major-release
難易度 1/5 1時間未満 初心者へのやさしさ 67/100
Intervention/image#1553 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
omegaup/omegaup#10353 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 61/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
effort: low graphiql ide impact: low scope: code quality type: chore
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
wp-graphql/wp-graphql#4486 ·
メンテナーはふだん 1 日以内に返信