[Edit Content]: System-wide TinyMCE config (get.vtl) is intermittently ignored because the editor initialises before /api/vtl/tinymceprops returns
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- angular, typescript
- 領域
- frontend
調査の方向性
Start with dot-wysiwyg-tinymce.component.ts and its HTML template, then read dot-wysiwyg-tinymce.component.spec.ts to see how the config request and editor initialization are wired. Reproduce the race with a delayed getProps() response and verify the editor receives the system-wide options after it resolves. Done means the editor waits for the response or failure, retains the documented merge order and fallback defaults, and the delayed-response test passes.
索引モデルが issue の本文から書いたものです。
説明
Problem Statement
The new Edit Content screen loads the system-wide WYSIWYG config from /api/vtl/tinymceprops, which serves /application/apivtl/tinymceprops/get.vtl. The editor doesn't wait for that response, so whether the config is applied depends on network timing. Usually it isn't, and the field falls back to dotCMS's default TinyMCE config with no error.
dot-wysiwyg-tinymce.component.ts loads the config asynchronously:
$wideConfig = toSignal<RawEditorOptions>(this.#dotWysiwygTinymceService.getProps());
and the template passes the merged config straight to the editor:
<editor [formControlName]="field.variable" [init]="$editorConfig()" ... />
@tinymce/tinymce-angular reads init once, when it calls tinymce.init(). If $wideConfig() is still undefined at that moment, the system-wide config is never used. A later update to $editorConfig() doesn't re-initialise the editor.
The tinymceprops field variable isn't affected, because it's read synchronously from the field definition.
How often: measured on a customer database restored locally.
- In-app navigation (Content Search → open a contentlet): 3 out of 3 opens got the defaults. TinyMCE is already loaded, so
tinymce.init()runs before the request can come back. - Full page load: 2 out of 2 got the defaults.
tinymce.min.jsfinished at about 860 ms and/api/vtl/tinymceprops9–14 ms later. - First load in a fresh session: the config was applied once. It's a race, not a consistent failure.
Who it affects: any customer that relies on get.vtl for site-wide editor settings, such as plugins, toolbars, content CSS or cleanup rules. That's the documented way to configure the WYSIWYG field system-wide. Their editors get dotCMS's default toolbar and plugins, so custom plugins, formats and validation rules go missing and content can be saved without the customer's cleanup rules applied. Because there's no error, it looks like intermittent misbehaviour rather than missing config.
Why the tests don't catch it: dot-wysiwyg-tinymce.component.spec.ts mocks getProps() with a synchronous of(...), so $wideConfig() already has its value when the editor initialises.
Browser/OS: Chrome on macOS. The race doesn't depend on the browser.
Steps to Reproduce
- Create
/application/apivtl/tinymceprops/get.vtlon the default site, saved by an admin or Scripting Developer, containing:#[[ { "plugins": "lists link table", "toolbar1": "bold italic | bullist | link | table", "menubar": true, "content_css": "/some/marker.css" } ]]# - Confirm
GET /api/vtl/tinymcepropsreturns that JSON. - Turn on the new editor for a content type with a WYSIWYG field and no
tinymcepropsfield variable. - Go to Content → Search and open a contentlet of that type.
- In the browser console, run
tinymce.activeEditor.options.get('toolbar1')andObject.keys(tinymce.activeEditor.plugins).
Expected: the toolbar and plugins from get.vtl, and a request for /some/marker.css.
Actual: dotCMS's default toolbar (undo redo | bold italic | alignleft ... dotAddImage hr) and default plugin list, and no request for marker.css. The Network tab shows /api/vtl/tinymceprops returning 200 with the right JSON after tinymce.min.js had already loaded.
To check the timing:
const e = performance.getEntriesByType('resource');
const t = n => Math.round(e.find(r => r.name.includes(n)).responseEnd);
({ props: t('/api/vtl/tinymceprops'), tinymce: t('tinymce.min.js') });
Acceptance Criteria
- The WYSIWYG field doesn't render
<editor>until/api/vtl/tinymcepropshas either returned or failed. For example, wrap it in@ifon a "loaded" state that'sundefinedwhile pending andnullon error. - If the request fails (404 when there's no
get.vtl, 403 when its last editor can't script, or 5xx), the editor still renders with the defaults plus the field variable, as it does today. - The system-wide config is applied every time: on first page load, on full reload, and when opening contentlets through in-app navigation.
- Merge order is unchanged:
DEFAULT_TINYMCE_CONFIG, then the system-wide config, then thetinymcepropsfield variable, then the forcediframe_*attributes andsetup. - The request is made at most once per page or session, not once per WYSIWYG field.
- A unit test makes
getProps()resolve after the editor would otherwise initialise (for example aSubjectemitted afterdetectChanges()) and asserts that the editor gets the system-wide options. The currentof(...)mock can't reproduce the race. - The field doesn't flicker or shift layout visibly while the config loads.
dotCMS Version
- Reproduced on
dotcms/dotcms:trunk, pulled 2026-11-10, with TinyMCE 6.8.4. - The async
toSignal(getProps())pattern was added in #30131 (2024-09-25, first in v24.10.02), so every version since then is likely affected. The customer is on 26.08.x.
Severity
High - Major functionality broken
The documented system-wide configuration for the new editor works only by chance. There's a workaround: copy the config JSON into every WYSIWYG field's tinymceprops field variable. It's tedious, and it breaks the legacy editor if done before a content type moves to the new editor.
Links
- Freshdesk: https://dotcms.freshdesk.com/a/tickets/37917
- Related: #36199 (
tinymcepropsfield variable no longer supports VTL in the new editor) - Slack: #feat-edit-content
- Code:
core-web/libs/edit-content/src/lib/fields/dot-edit-content-wysiwyg-field/components/dot-wysiwyg-tinymce/dot-wysiwyg-tinymce.component.ts($wideConfig,$editorConfig) and its.htmltemplate
- 主要言語
- Java
- スター
- 972
- フォーク
- 493
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 228
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotCMS/core のほかの issue
-
dotCMS : UVE OKR : Customer Support Team : Maintenance Type : Defect
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
OKR : Customer Support Team : Maintenance Type : Defect
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
Opening content from Content Search replaces the "Search" breadcrumb in the new Edit Content screenオープンdotCMS: New Edit Contentlet OKR : Customer Support Team : Falcon Type : Defect
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
Escape the Binary field hint in the legacy content editor so an apostrophe doesn't break the fieldオープンOKR : Customer Support Team : Maintenance Type : Defect
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 2 日以内に返信
-
dotCMS : Permissions OKR : Customer Support Team : Maintenance Type : Defect
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
desktop grp:about type:graphics-bug ui-public
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
it-at-m/Wahllokalsystem#3846 ·
メンテナーはふだん 2 日以内に返信
-
Area/Connector module/solace Priority/Low Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
ballerina-platform/ballerina-library#9849 ·
メンテナーはふだん 1 日以内に返信