ui/script registered with type=files is never loaded on the Files page
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 72/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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)
- Vorherrschende Sprache
- PHP
- Sterne
- 202
- Forks
- 30
- Ø Merge
- 3 T. 20 Std.
- Gemergte PRs (30 T.)
- 24
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus nextcloud/app_api
-
bug docker
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Daemon delete dialog: "Remove all ExApps" checkbox and `removeExApps` parameter have no effectOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
deploy discussion
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
nextcloud/app_api#1236 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
deploy docker enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug deploy docker
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in nextcloud/app_api
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Adyen/adyen-magento2#3453 ·
Maintainer antworten meist innerhalb von 8 Tagen
-
component/media domain/discovery
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement priority: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
magicsunday/webtrees-statistics#664 ·
Maintainer antworten meist innerhalb von 1 Tag