Patterns content-1 and features-2 request missing media 108–110 (404s in the editor)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 84/100
Hướng nghiên cứu
Mở inc/patterns/layout/content-1.php (khối Cover ở dòng 62, 74, 120) và inc/patterns/layout/features-2.php (khối Image ở dòng 56, 70), rồi xóa các thuộc tính "id" còn sót lại, cùng với bất kỳ class wp-image-<id> nào trên các khối Image, giữ nguyên các URL của Assets_Manager::get_image_url(). Đọc #3 trước để xem vì sao các URL được nối lại. Hoàn tất nghĩa là Front Page của Site Editor và các bản xem trước của inserter tải mà không có yêu cầu nào đến /wp-json/wp/v2/media/108–110 trong tab Network.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
Two of the theme's patterns point at images by attachment ID from the site they were made on. On any other site those attachments don't exist, so whenever the editor shows these patterns it asks for them and gets 404 (Not Found) in the browser console. That happens in the Site Editor (the Front Page template uses content-1), in the block inserter's previews, and in the editor.
inc/patterns/layout/content-1.php: three Cover blocks with"id":108(line 62),"id":109(line 74) and"id":110(line 120). Theirurlalready comes fromAssets_Manager::get_image_url(); only the IDs are left over.inc/patterns/layout/features-2.php: two Image blocks with"id":108(line 56) and"id":109(line 70).
The images themselves display, because the URLs point at the theme's own assets/img/ files. But the IDs trigger the failed requests on every site, and on a site that does have attachments 108–110 they would point the blocks at unrelated media from that site's library.
Related: #3, where content-1's images were being wired to Assets_Manager::get_image_url.
Step-by-step reproduction instructions
- On any site with Eduacademy 1.0.1 active, open the browser's developer tools (Console and Network tabs).
- Go to Appearance → Editor → Templates → Front Page.
- Watch the Network tab.
Expected: no failed requests.
Actual: GET /wp-json/wp/v2/media/108, /109 and /110 answer 404, and the console shows three "Failed to load resource" errors. The same happens when inserting the patterns from Patterns → Eduacademy Patterns.
Screenshots, screen recording, code snippet or Help Scout ticket
Fix suggestion: drop the "id" attribute (and the matching wp-image-<id> class on Image blocks, if present) from these five blocks, so they keep only the theme-asset URL.
Found while adding Eduacademy to the WordPress compatibility checks (Codeinwp/qa-compatibility#168). The same happens on every WordPress version tried (7.0.9, 7.1-RC1, 7.1.5).
Environment info
Eduacademy 1.0.1 (built from the v1.0.1 tag), WordPress 7.0.9 / 7.1-RC1 / 7.1.5, PHP 8.3, Chromium.
Is the issue you are reporting a regression
No
- Ngôn ngữ chính
- PHP
- Star
- 0
- Fork
- 0
- Merge trung bình
- 22 giờ 12 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không 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 Codeinwp/eduacademy
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Codeinwp/eduacademy#31 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Codeinwp/eduacademy#29 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Codeinwp/eduacademy#28 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
Codeinwp/eduacademy#32 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Codeinwp/eduacademy#6 ·
Tất cả issue của Codeinwp/eduacademy
Issue tương tự
-
Change: check an identifier filter the same way in every tool - the order of somcp_search_ordersĐang mởconsistency enhancement Orders
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
novalo-dev/Prestashop-MCP-Server#343 ·
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 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
claude
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sprain/sprainocchio#45 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày