Skip to content

fix(ui): strip customComponents from rows in reduceToSerializableFields#16787

Open
codeplott wants to merge 1 commit into
payloadcms:3.xfrom
codeplott:fix/seo-form-state-row-customcomponents
Open

fix(ui): strip customComponents from rows in reduceToSerializableFields#16787
codeplott wants to merge 1 commit into
payloadcms:3.xfrom
codeplott:fix/seo-form-state-row-customcomponents

Conversation

@codeplott
Copy link
Copy Markdown

What?

Make reduceToSerializableFields also strip customComponents from each entry in rows[].

Why?

The reducer only stripped customComponents from top-level field entries. Each Row carries its own customComponents (RowLabel) that can hold non-serializable refs. Under the Mongo adapter the rendered tree closes back to BasePayload via db.payload, so JSON.stringify on form state throws. This breaks PreviewField and the Auto-generate buttons in plugin-seo.

Fixes #
#16786

  The reducer only stripped customComponents from top-level field entries.
  Each Row carries its own customComponents (RowLabel) that can hold
  non-serializable refs. Under the Mongo adapter the rendered tree closes
  back to BasePayload via db.payload, so JSON.stringify on form state throws.
  This breaks PreviewField and the Auto-generate buttons in plugin-seo.

  Fixes payloadcms#16786
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.

1 participant