[5.x]: Moving an asset with “Replace it” throws TypeError: volumeUid must be of type string, null given
Maintainer thường phản hồi trong vòng 1 ngày
@i-just đang làm issue này rồi.
Từ ngày 28/10/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Bắt đầu tại AssetsController::actionMoveAsset() trong controller assets của control panel, ở nhánh mà force được đặt và asset xung đột được truy vấn bằng ->select(['elements.id']). Sau đó theo dõi lời gọi requireVolumePermissionByAsset() đến requireVolumePermission() để xác nhận volume UID là null, rồi mở rộng select để bao gồm assets.volumeId và assets.uploaderId. Hoàn thành khi: di chuyển một asset vào volume đã có file trùng tên, chọn "Replace it", thì file thực sự được di chuyển, trả về thông báo thành công và không còn ném TypeError volumeUid must be of type string, null given; tái hiện bằng hai volume cùng chứa một tên file.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened?
Description
When moving a file from one volume to another in Assets, if a file with the same filename exists in the other volume and you select the "replace it" option the file does not get moved but the toast says it has moved.
(Claude Code's bugfind and fix)
In AssetsController::actionMoveAsset(), when force is set, the conflicting asset is queried with ->select(['elements.id']), so volumeId is never loaded. The following requireVolumePermissionByAsset('deleteAssets', $conflictingAsset) then calls requireVolumePermission() with a null volume UID and throws a TypeError. The control panel still reports success, but nothing is moved.
Fix: also select assets.volumeId (and assets.uploaderId for the peer permission checks).
->select(['elements.id']) to ->select(['elements.id', 'assets.volumeId', 'assets.uploaderId'])
Steps to reproduce
- move an asset into a folder (here, a different volume) that already has an asset with the same filename, then choose “Replace it”.
Expected behavior
File is moved
Actual behavior
File is not moved and the following error is thrown: TypeError: volumeUid must be of type string, null given
Craft CMS version
5.11.5.1
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
- Ngôn ngữ chính
- PHP
- Star
- 3.6k
- Fork
- 710
- Merge trung bình
- 11 giờ 26 phút
- Pull request đã merge (30 ngày)
- 324
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 55/100
craftcms/cms#20171 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[5.x]: Block added through a draft gets an empty first revision on multi-site, so reverting deletes its nested contentCó thể đã có người làm @i-just đã nhận 1 ngày trước. Đang mởbug repo:cms
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
craftcms/cms#20151 · 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ó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
craftcms/cms#20150 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[5.x]: Passkeys registered with webauthn-lib v4 still fail with an uncaught InvalidUserHandleException (HTTP 500) after the #19530 fixCó thể đã có người làm @i-just đã nhận 9 ngày trước. Đang mởrepo:cms
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
craftcms/cms#20052 · 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]: Colored chips: link blue has low contrast on tinted backgroundsCó thể đã có người làm @brandonkelly đã nhận 15 ngày trước. Đang mởbug repo:cms
craftcms/cms#19984 · 3 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 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
0. Needs triage bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nextcloud/fulltextsearch#1061 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Resource]: Claude KitĐang mởresource-submission validation-passed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
hesreallyhim/awesome-claude-code#3375 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày