#111475Code editor: TypoScript completion leaves a rejected request unhandled for non-admins
Description
Problem
A code editor in TypoScript mode loads the templates of the page for its completion from the AJAX route codeeditor_codecompletion_loadtemplates. Only administrators may read them: for every other user CodeCompletionController::loadCompletions() answers with status 500 (“noPermission”).
TsCodeCompletion::loadExtTemplatesAsync() has no catch for that request, so the rejected promise stays unhandled. The browser reports an uncaught error in the console, and an end to end test that watches page errors fails on it.
Steps to reproduce
- Log in to the backend as an editor who is not an administrator.
- Open a record with a code editor in TypoScript mode on a page, for example the TSconfig of a page the editor may edit.
- Look at the browser console: the rejected request for the completion templates is reported as an uncaught error.
Cause
Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-code-completion.ts: loadExtTemplatesAsync() chains .then() on the request and nothing handles a rejection. The completion itself works without the templates, from the TypoScript reference alone.
Suggested fix
--- a/Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-code-completion.ts
+++ b/Build/Sources/TypeScript/backend/code-editor/autocomplete/ts-code-completion.ts
@@ -83,6 +83,9 @@ export class TsCodeCompletion {
.then(async (response) => {
this.extTsObjTree.c = await response.resolve();
this.resolveExtReferencesRec(this.extTsObjTree.c);
- });
+ })
+ .catch(() => {
+ // Only administrators may read the templates; the completion goes on with the TypoScript reference alone
+ });Reviews 2
History 13
-
Gerrit Code Review pushed patch set 1 for main to change 97753 status
NewUnder Review <span data-processor="relativetime" data-value="2026-11-17T15:19:54+00:00" > 11/17/26, 15:19 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 97772 <span data-processor="relativetime" data-value="2026-11-18T03:59:15+00:00" > 11/18/26, 03:59 </span>
-
Benjamin Kott commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-11-18T04:15:21+00:00" > 11/18/26, 04:15 </span>
Applied in changeset commit:031838fe1997941ced32e02d2b27f6f88fae49e9.