Skip to content

Commit

Permalink
fix: hidden or disabled fields were included in clientConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioGr committed Nov 25, 2024
1 parent e264631 commit 5f8f9f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/payload/src/fields/config/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const createClientField = ({
const disabledFromAdmin =
incomingField?.admin && 'disabled' in incomingField.admin && incomingField.admin.disabled

if (fieldAffectsData(clientField) && (isHidden || disabledFromAdmin)) {
if (fieldAffectsData(incomingField) && (isHidden || disabledFromAdmin)) {
return null
}

Expand Down Expand Up @@ -308,7 +308,7 @@ export const createClientFields = ({
i18n: I18nClient
importMap: ImportMap
}): ClientField[] => {
const clientFields: ClientField[] = new Array(fields.length)
const clientFields: ClientField[] = []

for (let i = 0; i < fields.length; i++) {
const field = fields[i]
Expand All @@ -321,7 +321,7 @@ export const createClientFields = ({
})

if (clientField) {
clientFields[i] = clientField
clientFields.push(clientField)
}
}

Expand Down

0 comments on commit 5f8f9f7

Please sign in to comment.