ui/script registered with type=files is never loaded on the Files page
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Read lib/Listener/LoadFilesPluginListener.php and lib/Controller/TopMenuController.php, then trace how ScriptsService::applyExAppScripts() is called for top-menu pages. Find the Files-page script loading entry point and determine how it can apply registered files scripts and styles. Done when a Files script registered through POST /api/v1/ui/script is injected on /apps/files/ and the existing top-menu behavior still works.
由索引模型根據 Issue 內容生成。
描述
What happens
POST /api/v1/ui/script accepts type=files and stores the entry (oc_ex_ui_scripts gets the row), but the script is never loaded on the Files page.
ScriptsService::applyExAppScripts() — the only thing that turns a registered script into a <script> tag — has exactly one caller:
lib/Controller/TopMenuController.php:72
$this->jsProxyMap = $this->scriptsService->applyExAppScripts($appId, 'top_menu', $menuEntry->getName());
So only ExApp top-menu pages get their scripts injected. LoadFilesPluginListener (the Files-page listener) only publishes ex_files_actions_menu and loads AppAPI's own app_api-filesplugin.js; it never calls applyExAppScripts.
Why it matters
An ExApp that registers a Files action via ui/files-actions-menu has no supported way to show progress or a result for it. The action is executed by AppAPI's plugin, which returns true/false and (optionally) honours redirect_handler, so a long-running action can only report success/failure — no progress, no link to its output. The natural approach (ui/script with type=files) silently does nothing.
Concretely: an OCR ExApp enqueues a job and returns 202. The user sees nothing until they refresh the folder, and there is no way to tell a queued job from a failed one.
Reproduction
- ExApp registers a script:
POST /api/v1/ui/script{"type": "files", "name": "files_action", "path": "js/foo"} oc_ex_ui_scriptscontainsappid | files | files_action | js/foo- Load
/apps/files/→ no<script>forproxy_js/*and no request to/apps/app_api/proxy/<appid>/js/foo.js
The same registration with type: top_menu works, because TopMenuController applies it.
Expected
ui/script (and ui/style) registered for type=files should be injected into the Files page, the same way top_menu entries are injected into their pages — e.g. a LoadAdditionalScriptsEvent listener that calls applyExAppScripts($appId, 'files', '').
Environment
- Nextcloud 34.0.5.1
- app_api 34.0.0 (checked against
main—lib/Listener/is unchanged there) - Deploy daemon: HaRP on a rootless podman socket (the script itself is served fine through the proxy:
GET /index.php/apps/app_api/proxy/<appid>/js/files_action.js→ 200text/javascript; it is simply never referenced)
- 主要語言
- PHP
- 星號
- 202
- 分支
- 30
- 平均合併
- 3 天 20 小時
- 30 天內合併 PR
- 24
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
nextcloud/app_api 的其他 Issue
-
bug docker
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
deploy discussion
難度 5/5 一週以上 新手友好度 20/100
nextcloud/app_api#1236 · 1 個 reaction ·
維護者通常 1 天內回覆
-
deploy docker enhancement
難度 4/5 3-5 天 新手友好度 48/100
維護者通常 1 天內回覆
-
bug deploy docker
難度 4/5 3-5 天 新手友好度 42/100
維護者通常 1 天內回覆
查看 nextcloud/app_api 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 77/100
Adyen/adyen-magento2#3453 ·
維護者通常 8 天內回覆
-
component/media domain/discovery
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
-
難度 2/5 1-3 小時 新手友好度 79/100
維護者通常 1 天內回覆
-
enhancement priority: low
難度 2/5 1-3 小時 新手友好度 82/100
magicsunday/webtrees-statistics#664 ·
維護者通常 1 天內回覆