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(client): avoid cannot getField by randomly generated name and throw error #294

Merged
merged 2 commits into from
Apr 17, 2022

Conversation

mytharcher
Copy link
Contributor

TypeError: Cannot read properties of undefined (reading 'collectionName')
(anonymous function)
./client/src/schema-component/antd/record-picker/ReadPrettyRecordPicker.tsx:23
  20 | const [record, setRecord] = useState({});
  21 | return (
  22 |   <div>
> 23 |     <BlockAssociationContext.Provider value={`${collectionField.collectionName}.${collectionField.name}`}>
     | ^  24 |       <CollectionProvider name={collectionField.target}>
  25 |         <Space size={0} split={<span style={{ marginRight: 4, color: '#aaa' }}>, </span>}>
  26 |           {toArr(field.value).map((record, index) => {

in ReadPrettyRecordPicker.tsx#L18-L19, fieldSchema.name is a randomly generated name, and cannot be find in collection.fields if those fields is manually named.

@mytharcher mytharcher requested a review from chenos April 17, 2022 02:12
@chenos chenos merged commit 8e11e8d into nocobase-next Apr 17, 2022
@chenos chenos deleted the fix/client-collection branch April 17, 2022 10:56
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.

2 participants