[Edit Content]: System-wide TinyMCE config (get.vtl) is intermittently ignored because the editor initialises before /api/vtl/tinymceprops returns
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 74/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- angular, typescript
- Área
- frontend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Java
- Estrellas
- 972
- Forks
- 493
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 228
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dotCMS/core
-
dotCMS : UVE OKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
OKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Opening content from Content Search replaces the "Search" breadcrumb in the new Edit Content screenAbiertodotCMS: New Edit Contentlet OKR : Customer Support Team : Falcon Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Escape the Binary field hint in the legacy content editor so an apostrophe doesn't break the fieldAbiertoOKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
dotCMS : Permissions OKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
Todos los issues de dotCMS/core
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
it-at-m/Wahllokalsystem#3846 ·
Los mantenedores suelen responder en 2 días
-
Area/Connector module/solace Priority/Low Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
ballerina-platform/ballerina-library#9849 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
Vakore/ZappierGames#327 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Radix number block generates NaN after switching a negative or decimal number to binary, octal or hexPosiblemente ocupada @matthewalberto la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
mit-cml/appinventor-sources#4246 · 1 comentario ·
Los mantenedores suelen responder en 1 día