UVE Quick Edit opens an empty form for related contentlets and saving it overwrites their values

Abierto
#38,621 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java, typescript
Área
backend, frontend

Línea de trabajo

Start in core-web/libs/portlets/edit-ema/portlet/src/lib/store/features/editor/withEditor.ts and trace $editorContentletEditData, getContentletsInContainer, and the Quick Edit save path. First check how the container lookup and DOM payload provide form values, then identify how the issue's proposed inode fetch or failure message should cover both traditional and headless pages. Done means related contentlets load stored values or cannot be saved from a blank form, while contentlets in containers retain current behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

dotCMS : UVE OKR : Customer Support Team : Maintenance Type : Defect
Problem Statement

In the Universal Visual Editor, Quick Edit opens an empty form for a contentlet that UVE can select but that is not one of the contentlets placed in the page's containers. The common case is a related contentlet (a child pulled in through a Relationship field) that a template marks up with the data-dot-object="contentlet" attributes so editors can select it. The same thing happens on headless pages.

UVE detects the element, draws the hover overlay and opens the contentlet menu. Full Editor loads the contentlet correctly. Edit (Quick Edit) opens the panel with every field blank and radio fields set to their default values.

Cause: $editorContentletEditData (core-web/libs/portlets/edit-ema/portlet/src/lib/store/features/editor/withEditor.ts) fills the form by searching for the selected identifier in pageAsset.containers[containerId] through getContentletsInContainer. A related contentlet is not in that list (only its parent is), so the lookup finds nothing. The panel then falls back to the DOM payload, which holds only the data-dot-* attributes and no field values.

Data loss (reproduced): the blank form still carries the real contentlet's inode. Changing any single field enables Save. Save then sends the whole form through saveQuickEditFields (EDIT workflow action), including empty strings (kept by filterFormValues) and radio defaults (from coerceFieldValue), which overwrites the contentlet's stored values.

Steps to Reproduce
  1. Create a child content type with a Text field (Heading) and a Radio field (Color, values Red|red / Blue|blue, default red). Create a parent content type with a Text field and a Relationships field (One to many) to the child.
  2. Create a child contentlet (Heading Child A, Color Blue) and a parent contentlet that relates it. Publish both.
  3. In the container code for the parent type, loop over the related children and wrap each one in an element carrying data-dot-object="contentlet", data-dot-inode, data-dot-identifier, data-dot-type, data-dot-basetype, data-dot-lang, data-dot-variant, data-dot-content-type-id, data-dot-can-edit="true" and data-dot-on-number-of-pages.
  4. Add the parent to a page and open the page in UVE. Hover over the child and click ⋮ → Full Editor: the values load correctly.
  5. Click ⋮ → Edit: Heading is empty and Color shows Red (the default).
  6. Type any value in Heading, which enables Save, and click Save.
  7. Open the child in the content editor: Color is now Red, so the stored value was overwritten.
Acceptance Criteria
  • Quick Edit loads the stored field values for a selected contentlet that is not in the page asset's container list, for example by fetching it by inode when the container lookup misses.
  • If the values can't be loaded, Quick Edit doesn't offer an editable blank form that can save over the stored contentlet (show a message and point to Full Editor instead).
  • Works on both traditional (Velocity) and headless pages.
  • Contentlets placed directly in containers behave exactly as they do today.
dotCMS Version

Reproduced on Evergreen 26.10.29-01. Reported on 26.11.06-03 and 26.11.10-02 (code path confirmed at tag v26.11.10-02).

Severity

High - Major functionality broken

Links
Lenguaje dominante
Java
Estrellas
972
Forks
493
Merge medio
2 d 12 h
PR fusionados (30 d)
228

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dotCMS/core

Todos los issues de dotCMS/core

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.