Skip to content

fix(ui): render named group child fields when permissions.fields is empty (Closes #17812) - #17813

Open
waterWang wants to merge 1 commit into
payloadcms:3.xfrom
waterWang:fix/group-child-fields-not-rendered
Open

fix(ui): render named group child fields when permissions.fields is empty (Closes #17812)#17813
waterWang wants to merge 1 commit into
payloadcms:3.xfrom
waterWang:fix/group-child-fields-not-rendered

Conversation

@waterWang

Copy link
Copy Markdown

Description

When a named group field renders its children, it passes permissions?.fields to the inner RenderFields component. If permissions.fields is empty or missing (e.g., when /api/access returns an empty fields object), the inner RenderFields receives undefined or {} as permissions. This causes getFieldPermissions to return read: false for all child fields, which are then filtered out by RenderFields — producing an empty .render-fields container.

Root cause: GroupField was the only container component that didn't fall back to the parent permissions object when permissions.fields was empty. Other containers (Row, Tabs, Collapsible) pass permissions directly, which includes read: true and allows child fields to render.

Changes

  1. Permissions fallback: When permissions.fields is empty or missing, fall back to the group's own permissions object instead of passing undefined. This aligns with how Blocks (BlockRow) handles the same scenario.

  2. forceRender propagation: Added forceRender to the props destructure and passed it to the inner RenderFields. This was already done by Row and Tabs but was missing in GroupField.

How to reproduce

See the minimal reproduction in the issue. Without this fix, named group fields render an empty RenderFields container — the header is visible but all child fields are missing.

Closes #17812

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