Block Editor: propagate nested content updates through relationship-chain hydration#35412
Block Editor: propagate nested content updates through relationship-chain hydration#35412
Conversation
Agent-Logs-Url: https://github.com/dotCMS/core/sessions/d1e48a0d-1911-4c15-b664-7b862a4d7df5 Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotCMS/core/sessions/d1e48a0d-1911-4c15-b664-7b862a4d7df5 Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotCMS/core/sessions/483a1fe0-7be8-4813-8c1f-87ff1790ac0b Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates Story Block hydration so that nested Story Block references embedded inside hydrated relationship payloads are also refreshed, enabling relationship-chain updates to propagate correctly.
Changes:
- Add recursive traversal to refresh Story Block values found inside nested relationship payload maps/lists (with a bounded traversal depth).
- Reduce the nested refresh traversal ceiling and document why it’s safe given the existing relationship depth cap (0–3).
- Add an integration test covering nested publish propagation through a Story Block → relationship → Story Block chain.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
dotCMS/src/main/java/com/dotcms/contenttype/business/StoryBlockAPIImpl.java |
Adds bounded recursive refresh of nested Story Block values within relationship-hydrated payload structures. |
dotcms-integration/src/test/java/com/dotcms/contenttype/business/StoryBlockAPITest.java |
Adds coverage asserting nested Story Block content refreshes after publishing a deeply nested referenced contentlet. |
…in StoryBlockAPIImpl Agent-Logs-Url: https://github.com/dotCMS/core/sessions/adf886a0-14d8-44b9-a5c9-85b7680f63f5 Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
… avoid unnecessary allocations Agent-Logs-Url: https://github.com/dotCMS/core/sessions/44a24ef3-b512-4211-beba-a67444fb06b6 Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
|
@copilot fix conflicts |
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
Head branch was pushed to by a user without write access
…cycle detection Agent-Logs-Url: https://github.com/dotCMS/core/sessions/85256f4d-c5e2-41e4-b7c3-fc71bd3e079a Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
|
Claude finished @fmontes's task in 6m 6s —— View job Review
Overall: The StackOverflow fix (ThreadLocal cycle detection) and the nested Story Block refresh are both correct in their core logic. Three things worth looking at: 1.
|
…BlockField handling When a content type has a StoryBlockField, the FieldDataGen test utility auto-creates a companion _raw TextField with a plain-text default value like 'testDefaultValue1776903544700'. refreshContentlet() was unconditionally calling toMap() on this _raw value, which threw JsonParseException and aborted the method before processing RelationshipFields. This left the relationship data absent from the story block data map, causing initialNewsData/initialNewsList to be null in the new integration tests. Fix: check isValidJSON on both _raw and the primary value, falling back gracefully if neither is valid JSON. Agent-Logs-Url: https://github.com/dotCMS/core/sessions/f41bd29d-ba42-4f34-bea3-41a7a5e519da Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
We had an incident on the merge queue and we lost these changes Main PR dotCMS#35412 Closes: dotCMS#35408 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com> Co-authored-by: Freddy Montes <freddymontes@gmail.com>
nested-block-editor.mp4
refreshContentletto not throwJsonParseExceptionon non-JSON_rawdefault values