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

オープン
#38,621 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, typescript
領域
backend, frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Java
スター
972
フォーク
493
平均マージ
2日 12時間
マージ済み PR(30日)
228

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotCMS/core のほかの issue

dotCMS/core の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。