RGJ
(Richard - Communiteq)
23.Февраль.2026 11:09:38
1
Ссылка на короткую ссылку для экспорта пользователя на странице администратора пользователей не работает при настройке в подпапке — возвращается страница «Упс! Эта страница не существует или является частной».
Ссылка работает из сообщения PM.
При нажатии F5 на странице «Не найдено» или при щелчке правой кнопкой мыши по ссылке файл также скачивается, поэтому, похоже, это проблема маршрутизации Ember.
Строка: discourse/frontend/discourse/admin/components/admin-user-exports-table.gjs at 6759ad71cac395697b2978eb34fcfbf1162d30d1 · discourse/discourse · GitHub
Быстрое (и, полагаю, не совсем чистое) решение: добавить target="_blank".
3 лайка
Спасибо, @RGJ Это будет исправлено в
main ← fix/server-side-only-urls-subfolder
merged 05:32PM - 23 Feb 26 UTC
On subfolder setups, clicking server-side-only links (e.g. upload download links… on the admin user exports page) resulted in a "page doesn't exist" error instead of downloading the file.
When Discourse runs in a subfolder (e.g. /forum), URLs like `/forum/uploads/short-url/abc.csv.gz` were not matching the SERVER_SIDE_ONLY regex patterns (e.g. `/^\/uploads\//`) because the pathname still included the subfolder prefix at the point of the check. This caused `routeTo` to hand the URL to Ember's router instead of redirecting to the server, hitting the catch-all "unknown" route.
The fix strips the subfolder prefix using `withoutPrefix()` before checking against SERVER_SIDE_ONLY patterns. The original path (with prefix) is still passed to `redirectTo`, which correctly handles both prefixed and unprefixed URLs via `getURL()`.
This only surfaced for the admin user exports page because most upload links in post content go through `click-track.js` which calls `redirectTo()` directly for `.attachment` links, bypassing `routeTo()` and its SERVER_SIDE_ONLY check entirely.
https://meta.discourse.org/t/396783
3 лайка
zogstrip
Закрыл(а) тему
28.Февраль.2026 07:00:18
5
Эта тема была автоматически закрыта через 4 дня. Новые ответы больше не допускаются.