Images in pages keep the address the site had at upload, so they break when the site moves
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- backend
Hướng nghiên cứu
Start in system/core/pages.php at the upload/image handler, then trace how the editor stores its returned URL and how hypha_make_relative() is used. Check the linked pull request #641 for the current approach. Done means uploaded images are stored as relative images/<file> paths and continue loading after the site address changes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
After a site moves to another address, the images in its text pages and articles no longer show. The browser asks the old address for them, for example https://old.example.org/images/5f0c0ffee0b1a.png, while the file is in data/images of the site at the new address.
The same happens when the old address still answers but no longer serves the images (it gives a 404 or 500).
Cause
- The image upload (
upload/imageinsystem/core/pages.php) answers with an absolute URL:$hyphaUrl . 'images/...'. - The editor puts that URL in the text as it is.
- Text pages and articles do not run
wikify()on save, sohypha_make_relative()never makes the URL relative.
So the stored text holds the scheme and host of the site at the time of the upload. Behind a proxy that terminates TLS, the scheme can also be wrong (see #398).
To reproduce
- Upload an image in a text page on
http://a.example.org/. - Copy the data folder to a site at
http://b.example.org/, and switch offa.example.org. - Open the page on
b.example.org: the image points toa.example.org.
Expected
The site serves its own images, whatever address it had when they were uploaded: a relative images/<file>.
- Ngôn ngữ chính
- JavaScript
- Star
- 5
- Fork
- 9
- Merge trung bình
- 18 giờ 7 phút
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 PlanBCode/hypha
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Impact: Medium Level: Easy Type: Bug Value: Users
Độ 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
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Impact: Low Level: Easy Type: Bug Value: Coders
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
PlanBCode/hypha#586 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của PlanBCode/hypha
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
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 82/100
feimacode/open-design-agent-kit#66 ·
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 70/100
xojs/eslint-config-xo#134 ·
-
FEATURE REQUEST
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
linuxmint/cinnamon-spices-extensions#1193 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
huggingface/transformers.js#1839 ·
Maintainer thường phản hồi trong vòng 1 ngày