fix(ui) When opening drawer(like media drawer) error is written to the log #8223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #7497
It's a small fix which will clear our logs at last Quoting from the issue:
When opening drawer(like media drawer) error is written to the log.
This relates to next fixed issue
(https://github.com/payloadcms/payload/pull/7117/files)
In file:
packages/ui/src/utilities/buildFormState.ts - Lines 70-74
` const schemaPathSegments = schemaPath && schemaPath.split('.')
let fieldSchema: Field[]
if (schemaPathSegments.length === 1) {
`
What happens is the first line fixes case where schemaPath is null | undefined,
now the last line there fails of schemaPathSegments is null | undefined
It's reported in few issues , I am not trying to resolve why next.js is not stopping the reques processing , just don't want to see it in the logs