Opening an /index.php/apps/deck/... URL on a pretty-URL instance rewrites it to /apps/deck/index.php/apps/deck/...
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đá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
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu từ src/router.js quanh đoạn tính URL gốc (dòng 16-23), rồi so sánh với bước dọn /index.php trong App.vue mounted(). Để tái hiện, mở /index.php/apps/deck/board/<id>/card/<id> trên một instance có modRewriteWorking === true và quan sát lần gọi routerHistory.replace đầu tiên. Xong khi một URL như vậy giữ nguyên như đã mở hoặc được chuẩn hóa thành /apps/deck/board/<id>/card/<id>, và việc điều hướng URL thân thiện thông thường vẫn hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
On an instance with pretty URLs enabled (front_controller_active, so OC.config.modRewriteWorking === true), opening a Deck URL that contains /index.php leaves the browser at a doubled path:
https://cloud.example.com/index.php/apps/deck/board/5/card/1589
→ address bar: https://cloud.example.com/apps/deck/index.php/apps/deck/board/5/card/1589
/index.php/... links are common: Nextcloud's server generates them whenever pretty URLs are off, and integrations use them because they work on every instance.
Cause
const baseUrl = generateUrl('/apps/deck/')
const webRootWithIndexPHP = getRootUrl() + '/index.php'
const doesURLContainIndexPHP = window.location.pathname.startsWith(webRootWithIndexPHP)
const currentBaseUrl = doesURLContainIndexPHP ? baseUrl : baseUrl.replace('/index.php/', '/')
This assumes generateUrl('/apps/deck/') always returns /index.php/apps/deck/. When modRewriteWorking is true it returns /apps/deck/, so a URL that does contain /index.php gets the base /apps/deck/. Then:
- vue-router can't strip that base from
/index.php/apps/deck/board/5/card/1589, so the route path is the whole pathname. - On the first navigation the router calls
routerHistory.replace(fullPath), i.e.replaceState(base + fullPath)=/apps/deck+/index.php/apps/deck/board/5/card/1589.
The cleanup in App.vue mounted() (redirect when $route.path starts with /index.php) doesn't rescue it in practice.
To Reproduce
- Use an instance with pretty URLs enabled (
htaccess.RewriteBaseset, Apache with mod_rewrite). - Open
https://<host>/index.php/apps/deck/board/<id>/card/<id>(or/index.php/apps/deck/board/<id>). - The address bar shows
https://<host>/apps/deck/index.php/apps/deck/board/<id>/....
Expected behavior
The URL stays as opened, or is normalised to /apps/deck/board/<id>/card/<id>.
Possible fix
Build the base from the current URL rather than from generateUrl():
const webRoot = getRootUrl()
const doesURLContainIndexPHP = window.location.pathname.startsWith(webRoot + '/index.php/')
const currentBaseUrl = webRoot + (doesURLContainIndexPHP ? '/index.php' : '') + '/apps/deck/'
Workaround
/index.php/apps/deck/card/<cardId> (page#redirectToCard) works, because the server redirects with linkToRouteAbsolute(), which drops index.php when pretty URLs are on. Board links have no equivalent redirect route.
Server details
Web server: Apache (official nextcloud Docker image, Helm chart, apache-pretty-urls.config.php enabled)
Nextcloud version: 35.0.3
Deck: current release from the app store. The code above is unchanged on main at 5be5601a.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.4k
- Fork
- 369
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 86
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- 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 nextcloud/deck
-
Federated board stacks return 500: getReadMark() called with null user in CardService::enrichCards()Có thể đã có người làm @mayankm00007 đã nhận 8 ngày trước. Đang mở1. to develop bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nextcloud/deck#8721 · 1 bình luận ·
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 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
DeckProvider::setSubjects() overwrites IEvent subject with translated sentence → InvalidValueException, Deck bell notifications silently droppedCó thể đã có người làm @tcarrondo đã nhận 26 ngày trước. Đang mở0. Needs triage bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
nextcloud/deck#8591 · 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 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
CSV export leaves trailing commas in tags and assigned-user fieldsCó thể đã có người làm @Kumar-s75 đã nhận 76 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
nextcloud/deck#8361 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nextcloud/deck
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
louislam/uptime-kuma#8257 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 1/5 Dưới một 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
-
Độ 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
-
good first issue help wanted translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug documentation
Độ 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