Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: passes field permissions to custom fields #10024

Merged
merged 4 commits into from
Dec 17, 2024

Conversation

jacobsfletch
Copy link
Member

@jacobsfletch jacobsfletch commented Dec 17, 2024

Fixes #9888. Field permissions were not being passed into custom components. This led to custom components, such as arrays and blocks, unable to render default Payload fields. This was because their props lacked the permissions object required for rendering. For example:

'use client'
import type { ArrayFieldClientComponent } from 'payload'
import { ArrayField } from '@payloadcms/ui'

export const MyArray: ArrayFieldClientComponent = (props) => <ArrayField {...props} />

In this example the array field itself would render, but the fields within each row would not, because the array field did not pass its permissions down to the rows.

@jacobsfletch jacobsfletch marked this pull request as ready for review December 17, 2024 16:40
@jacobsfletch jacobsfletch merged commit eb037a0 into main Dec 17, 2024
69 checks passed
@jacobsfletch jacobsfletch deleted the fix/custom-field-permissions branch December 17, 2024 17:17
Copy link
Contributor

🚀 This is included in version v3.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fields are not rendered when type Array has a custom field
1 participant