[6.x]: yii2-adapter: yii\db\Expression assigned to an ActiveRecord attribute becomes a JSON string
Maintainer thường phản hồi trong vòng 1 ngày
@riasvdv đang làm issue này rồi.
Từ ngày 13/10/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- PHP
- Star
- 3.6k
- Fork
- 706
- Merge trung bình
- 12 giờ 34 phút
- Pull request đã merge (30 ngày)
- 268
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của craftcms/cms
-
bug repo:cms
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
craftcms/cms#19980 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[6.x]: Text in some input fields is clipped at the bottom on WindowsCó thể đã có người làm @brianjhanson đã nhận 6 ngày trước. Đang mởbug repo:cms
craftcms/cms#19928 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug repo:cms
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
craftcms/cms#19916 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[6.x]: AdminTable not available for plugin index and settings screensCó thể đã có người làm @brianjhanson đã nhận 6 ngày trước. Đang mởbug repo:cms
craftcms/cms#19912 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[6.x]: No way for custom element types to add top level buttons in toolbar or beside the Save menuCó thể đã có người làm @brianjhanson đã nhận 6 ngày trước. Đang mởbug repo:cms
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
craftcms/cms#19910 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Automattic/blocks-engine#2866 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Good first issue: add laravel-inertia stack budget preset (Laravel 11 + Inertia.js + PHP 8.3)Đang mởenhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
backend gamification P0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
semanadeinformatica/website#461 ·
-
HttpRequestTrait fatals on WordPress 7.2: $blocked_http_requests clashes with WP_UnitTestCase_BaseĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
area: docs eco: php good first issue help wanted lane: free-agent roadmap size: XS type: docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
arminazimi/evergreen#453 ·
Maintainer thường phản hồi trong vòng 1 ngày