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) Cannot read properties of undefined obs when opening edit /view mode of a form #132

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

ODORA0
Copy link
Member

@ODORA0 ODORA0 commented Oct 18, 2023

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

The FormFieldHandlers resolves all available handlers but was returning as undefined causing an error when opening a form view or edit action. Solution was to create a guard clause within the useEffect hook to check if is falsy and return an object thus preventing potential errors when trying to access properties of null or undefined.

Screenshots

image

Related Issue

Other

@pirupius pirupius merged commit a68f279 into openmrs:main Oct 25, 2023
7 checks passed
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