Skip to content

Fix RichTextValue serialization when nested in Dict or List - #2039

Closed
erral wants to merge 2 commits into
mainfrom
fix-richtext-nested-serialization
Closed

Fix RichTextValue serialization when nested in Dict or List#2039
erral wants to merge 2 commits into
mainfrom
fix-richtext-nested-serialization

Conversation

@erral

@erral erral commented Jul 30, 2026

Copy link
Copy Markdown
Member

This PR adds a global IJsonCompatible converter for IRichTextValue.

Previously, RichTextValue was only serializable when a context was available (via IContextawareJsonCompatible). However, when a RichTextValue is nested inside a Dict or List, the recursive json_compatible call is often made without a context, leading to a TypeError.

By adding a non-context-aware converter that defaults to using the .raw value, we provide a safe fallback that prevents these crashes.

@mister-roboto

Copy link
Copy Markdown

@erral thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@erral erral closed this Jul 30, 2026
@erral
erral deleted the fix-richtext-nested-serialization branch July 30, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants